string.gsub()

string.gsub (s, pattern, repl [, n])snpattern§6.4.1replgsubgsubGlobal SUBstitution If repl is a string, then its value is used for replacement. The character % works as an escape character: any sequence in repl of the form %d, with d between 1 and 9, stands for the value of the d-th captured substring. The sequence %0 stands for the whole match. The sequence %% stands for a single %. If repl is a table, then the table is queried for every match, using the first capture as the key. If repl

string.len()

string.len (s)"""a\000bc\000"

string.lower()

string.lower (s)

string.match()

string.match (s, pattern [, init])matchpattern§6.4.1smatchnilpatterninit

string.pack()

string.pack (fmt, v1, v2, ···) Returns a binary string containing the values v1, v2, etc. packed (that is, serialized in binary form) according to the format string fmt (see §6.4.2).

string.packsize()

string.packsize (fmt) Returns the size of a string resulting from string.pack with the given format. The format string cannot have the variable-length options 's' or 'z' (see §6.4.2).

string.rep()

string.rep (s, n [, sep])nssepsepn (Note that it is very easy to exhaust the memory of your machine with a single call to this function.)

string.reverse()

string.reverse (s)s

string.sub()

string.sub (s, i [, j])sijijjstring.sub(s,1,j)sjstring.sub(s, -i)isi If, after the translation of negative indices, i is less than 1, it is corrected to 1. If j is greater than the string length, it is corrected to that length. If, after these corrections, i is greater than j, the function returns the empty string.

string.unpack()

string.unpack (fmt, s [, pos]) Returns the values packed in string s (see string.pack) according to the format string fmt (see §6.4.2). An optional pos marks where to start reading in s (default is 1). After the read values, this function also returns the index of the first unread byte in s.