These are all externs for the lua-utf8 library, which functions as an additional set of string tools.
Note that all relevant indexes are "1" based.
Returns the internal numerical codes of the characters
Note that numerical codes are not necessarily portable across platforms.
Receives zero or more integers. Returns a string with length equal to the number of arguments, in which each character has the internal numerical code equal to its corresponding argument. Note that numerical codes are not necessarily portable across platforms.
Looks for the first match of pattern in the string
If it finds a match, then
find returns the indices of
str where this
occurrence starts and ends.
If the target has captures, then in a successful match the captured values are also returned, after the two indices.
specifies where to start the search; its default value is
turns off the pattern matching facilities, so the function does
a plain "find substring" operation, with no characters in pattern
being considered "magic". Note that if plain is given, then
Returns an iterator function that, each time it is called, returns the next
captures from pattern over string
pattern specifies no captures,
then the whole match is produced in each call.
Receives a string and returns its length. The empty string
0. Embedded zeros are counted, so
"a\000bc\000" has length
Receives a string and returns a copy of this string with all uppercase letters changed to lowercase. All other characters are left unchanged. The definition of what an uppercase letter is depends on the current locale.
Looks for the first match of pattern in the string s. If it finds one,
then match returns the captures from the pattern; otherwise it returns
If pattern specifies no captures, then the whole match is returned.
The optional argument
n specifies where to start the search;
its default value is
1 and can be negative.
Returns the substring of
str that starts at
start and continues until
end can be negative. If
end is absent, then it is assumed to be
-1 (which is the same as the string length).
In particular, the call
sub(str,1,end) returns a prefix of
sub(str, -end) returns a suffix of