Game Development Reference
In-Depth Information
string.rep ( s, n )
This function returns a string that contains n repetitions of the string s passed. This is equivalent to
replicate in some other languages. For example
print(string.rep("*",10)
would print the following:
**********
string.reverse ( s )
s in reverse.
s , such that it starts at the
i and continues until j . While many other languages specify a length after the start position,
i is 1, and it can also be set to negative. If j is
absent, it is given the default value of −1 (i.e., the end of the string).
string.upper ( s )
This function returns a copy of the string with all the lowercase characters changed to uppercase.
All other characters are left unchanged. This again depends on the current locale for what letters are
considered lowercase.
Patterns
If you are new to development or have not used languages that have built-in pattern matching or
regex-like functions, then you might be wondering what patterns are. There are four fundamental
concepts in Lua:
Character class
Pattern item
Pattern
Capture
 
Search WWH ::




Custom Search