string
The string library provides generic functions to manipulate strings, such as to extract substrings or match patterns. You can access the string library by the global string library.
See String pattern reference for details on using string.match(), string.gmatch(), and string.gsub() to find (and replace) substrings.
Resumo
Funções
Returns the internal numerical codes of the characters s[i], s[i+1], ..., s[j]. The default value for i is 1; the default value for j is i. These indices are corrected following the same rules of function string.sub.
Receives zero or more integers and 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.
Looks for the first match of pattern in the string s and returns the indices of s where the occurrence starts and ends.
Returns a formatted version of its variable number of arguments following the description given in its first argument, which must be a string.
Returns an iterator function that returns the next captures from pattern over the string s each time it's called.
Returns a copy of s in which all or the first n occurrences of the pattern are replaced with the given replacement. The second value returned is the total number of substitutions made.
Returns the length of a string.
Returns a copy of a string with all uppercase letters changed to lowercase.
Looks for the first match of pattern in the string s. If a match is found, it is returned; otherwise, it returns nil. A third, optional numerical argument, init, specifies where to start the search.
Returns a binary string containing the provided arguments.
Returns the size in bytes of any string packed with a given description.
Returns a string that is the concatenation of n copies of the string s.
Returns a string that is the string s reversed.
Splits a string into parts based on the defined separator character(s), returning a table of ordered results.
Returns the substring of s that starts at i and continues until and including j. i and j can be negative. i defaults to 1 and j defaults to -1.
Extracts the values packed in the provided binary string.
Returns a copy of a string with all lowercase letters changed to uppercase.