Optional 'init' argument to 'string.gmatch'
The function 'string.gmatch' now has an optional 'init' argument, similar to 'string.find' and 'string.match'. Moreover, there was some reorganization in the manipulation of indices in the string library. This commit also includes small janitorial work in the manual and in comments in the interpreter loop.
This commit is contained in:
@@ -94,6 +94,11 @@ assert(string.char(string.byte("\xe4l\0
|
||||
assert(string.char(string.byte("\xe4l\0<EFBFBD>u", 1, 0)) == "")
|
||||
assert(string.char(string.byte("\xe4l\0<EFBFBD>u", -10, 100)) == "\xe4l\0<EFBFBD>u")
|
||||
|
||||
checkerror("out of range", string.char, 256)
|
||||
checkerror("out of range", string.char, -1)
|
||||
checkerror("out of range", string.char, math.maxinteger)
|
||||
checkerror("out of range", string.char, math.mininteger)
|
||||
|
||||
assert(string.upper("ab\0c") == "AB\0C")
|
||||
assert(string.lower("\0ABCc%$") == "\0abcc%$")
|
||||
assert(string.rep('teste', 0) == '')
|
||||
|
||||
Reference in New Issue
Block a user