String member reference

July 17, 2023 · View on GitHub

Functions returning integer

NameTypeResult
s.lengthinteger The number of characters in s
s1.compareto(s2)integerNegative if s1 is alphabetically < s2, 0 if equal, positive if >
s1.indexof(s2)integerThe position of s2 within s1, -1 if not found

Functions returning string

NameTypeResult
s.slice(pos,count)stringcount characters from s, starting at pos. If pos is negative, the position is relative to the end of the string, with -1 being the last character of the string. count may be completely omitted, in which case characters from pos until the end of the string is returned.
s.upperstringUpper case version of s
s.lowerstringLower case version of s

Further reading

Index and reference