Lua.VM.Stdlib.String (Lua v1.0.0-rc.2)
View SourceString standard library functions for Lua 5.3.
This module implements the Lua string library, providing functions for string
manipulation. All functions are registered in the global string table when
the standard library is installed.
Implemented Functions
string.lower(s)- converts string to lowercasestring.upper(s)- converts string to uppercasestring.len(s)- returns length of string in bytesstring.sub(s, i [, j])- extracts substring (1-based indexing)string.rep(s, n [, sep])- repeats string with optional separatorstring.reverse(s)- reverses a stringstring.byte(s [, i [, j]])- returns byte values of charactersstring.char(...)- creates string from byte valuesstring.format(fmt, ...)- C-style string formatting
Pattern Matching
string.find(s, pattern [, init [, plain]])- find pattern in stringstring.match(s, pattern [, init])- match pattern and return capturesstring.gmatch(s, pattern)- iterate over all matchesstring.gsub(s, pattern, repl [, n])- global substitution