String
Look up string calls and properties.
string.len(s)
Count Unicode characters.
- Arguments
s: string. Optional separator: string.- Returns
The number of Unicode scalar values, not bytes or visible combined characters.
- Works with
Strings.
- Missing values and errors
Wrong argument counts or types report an error.
debug.log(string.len("hello"))string.lower(s)
Convert text to lowercase.
- Arguments
s: string. Optional separator: string.- Returns
A new string.
- Works with
Strings.
- Missing values and errors
Wrong argument counts or types report an error.
debug.log(string.lower("HELLO"))string.upper(s)
Convert text to uppercase.
- Arguments
s: string. Optional separator: string.- Returns
A new string.
- Works with
Strings.
- Missing values and errors
Wrong argument counts or types report an error.
debug.log(string.upper("hello"))string.reverse(s)
Reverse text characters.
- Arguments
s: string. Optional separator: string.- Returns
A new string. Reverses Unicode scalar values; combined characters may separate.
- Works with
Strings.
- Missing values and errors
Wrong argument counts or types report an error.
debug.log(string.reverse("abc"))string.split(s [, separator])
Split text into pieces.
- Arguments
s: string. Optional separator: string.- Returns
A basket of strings. Without a separator, splits into Unicode scalar values.
- Works with
Strings.
- Missing values and errors
Wrong argument counts or types report an error.
debug.log(string.split("one,two", ","))[BETA] marks features newer than the current public release. Current release: 0.8.0.