We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04d61b1 commit 6fe9edaCopy full SHA for 6fe9eda
functions/UTF8_Library/examples/utf8.byte-1.lua
@@ -1,6 +1,6 @@
1
local input = "Ницца!"
2
-local codepoints = { utf8.byte( input, 1, utf8.len(input) ) }
+local codepoints = {utf8.byte(input, 1, utf8.len(input))}
3
4
-for index, codepoint in ipairs( codepoints ) do
5
- outputConsole( "Codepoint @ ".. index .." = ".. codepoint )
6
-end
+for index, codepoint in ipairs(codepoints) do
+ outputConsole("Codepoint @ " .. index .. " = " .. codepoint)
+end
functions/UTF8_Library/examples/utf8.byte-2.lua
@@ -1,2 +1,2 @@
-local first = utf8.byte( "Multi Theft Auto", 1, 1 )
-outputConsole( first ) -- 77
+local first = utf8.byte("Multi Theft Auto", 1, 1)
+outputConsole(first) -- 77
functions/UTF8_Library/examples/utf8.char-1.lua
@@ -1,5 +1,5 @@
local input = "Hello World"
-local joined = utf8.char( unpack(codepoints) )
+local joined = utf8.char(unpack(codepoints))
-print( joined ) -- Hello World
+print(joined) -- Hello World
functions/UTF8_Library/examples/utf8.char-2.lua
-local mta = utf8.char( 77, 84, 65 )
-print( mta ) -- MTA
+local mta = utf8.char(77, 84, 65)
+print(mta) -- MTA
functions/UTF8_Library/examples/utf8.char-3.lua
@@ -3,14 +3,14 @@ local codepoints = {}
-- Extract first 5 characters (read: Mutli)
for index = 1, 5 do
- codepoints[index] = utf8.byte( input, index )
+ codepoints[index] = utf8.byte(input, index)
7
end
8
9
local output = ""
10
11
-- Join the first 5 characters together
12
for index = 1, #codepoints do
13
- output = output .. utf8.char( codepoints[index] )
+ output = output .. utf8.char(codepoints[index])
14
15
16
-outputConsole( output ) -- Multi
+outputConsole(output) -- Multi
functions/UTF8_Library/examples/utf8.charpos-1.lua
-local position, codepoint = utf8.charpos( "Привет", 2 )
-print( position, codepoint ) -- 3, 1088
+local position, codepoint = utf8.charpos("Привет", 2)
+print(position, codepoint) -- 3, 1088
functions/UTF8_Library/examples/utf8.charpos-2.lua
@@ -1,9 +1,9 @@
local input = "Привет мир" -- Hello World
-local from = utf8.charpos( input, 1 ) -- 1
-local to = utf8.charpos( input, 2 ) -- 3
+local from = utf8.charpos(input, 1) -- 1
+local to = utf8.charpos(input, 2) -- 3
local byteLength = to - from
-outputConsole( byteLength ) -- 2
+outputConsole(byteLength) -- 2
-local character = string.sub( input, from, byteLength )
-outputConsole( character ) -- П
+local character = string.sub(input, from, byteLength)
+outputConsole(character) -- П
functions/UTF8_Library/examples/utf8.escape-1.lua
-local output = utf8.escape( "%123 %u123 %{123} %u{123} %xABC %x{ABC}" )
-print( output ) -- { { { { ઼ ઼
+local output = utf8.escape("%123 %u123 %{123} %u{123} %xABC %x{ABC}")
+print(output) -- { { { { ઼ ઼
-local output = utf8.escape( "%%123 %? %d %%u" )
-print( output ) -- %123 ? d %u
+local output = utf8.escape("%%123 %? %d %%u")
+print(output) -- %123 ? d %u
functions/UTF8_Library/examples/utf8.find-1.lua
@@ -1,12 +1,12 @@
-print( utf8.find( "Hello MTA User", "User" ) ) -- 11, 14
-print( utf8.find( "Hello MTA User", "e" ) ) -- 2, 2
-print( utf8.find( "Hello MTA User", "e", 3 ) ) -- 13, 13
-print( utf8.find( "Привет Привет", "%s" ) ) -- 7, 7
-print( utf8.find( "Привет Привет", "%s", 1, true ) ) -- nil
+print(utf8.find("Hello MTA User", "User")) -- 11, 14
+print(utf8.find("Hello MTA User", "e")) -- 2, 2
+print(utf8.find("Hello MTA User", "e", 3)) -- 13, 13
+print(utf8.find("Привет Привет", "%s")) -- 7, 7
+print(utf8.find("Привет Привет", "%s", 1, true)) -- nil
-- Comparsion of utf8.find and string.find
-local startpos, endpos = utf8.find( "Привет", "и" )
-print( startpos, endpos ) -- 3, 3
+local startpos, endpos = utf8.find("Привет", "и")
+print(startpos, endpos) -- 3, 3
-local startpos, endpos = string.find( "Привет", "и" )
-print( startpos, endpos ) -- 5, 6
+local startpos, endpos = string.find("Привет", "и")
+print(startpos, endpos) -- 5, 6
functions/UTF8_Library/examples/utf8.fold-1.lua
-local output = utf8.lower( "WHAT ARE YOU UP TO? Do you like uppercase?" )
-print( output ) -- what are you up to? do you like uppercase?
+local output = utf8.lower("WHAT ARE YOU UP TO? Do you like uppercase?")
+print(output) -- what are you up to? do you like uppercase?
-local value = utf8.fold( 1088 )
-print( type( value ) ) -- number
+local value = utf8.fold(1088)
+print(type(value)) -- number
0 commit comments