Name
string
- string
option arg... Perform string operations on one or more strings, based on the value of
option. String indices start at 0.- string compare
string1 string2 Compare strings lexicographically. Return −1 if
string1is less thanstring2, 0 if equal, or 1 if greater.- string first
string1 string2 Return the index of the first occurrence of
string1instring2, or −1 if no match.- string index
string charIndex Return the character in
stringthat has indexcharIndex. Return empty string ifcharIndexis out of range.- string last
string1 string2 Return the index of the last occurrence of
string1instring2, or −1 if no match.- string length
string Return the length of
stringin characters.- string match
pattern string Return 1 if
stringmatches glob patternpattern; otherwise, return 0.- string range
string first last Return substring of
stringconsisting of characters from indexfirstthroughlast. Lastcan be the string "end".- string tolower
string Return
stringconverted to lowercase.- string toupper
string Return
stringconverted to uppercase.- string trim
string [chars] Return
stringwith leading and trailing characters from the setcharsremoved (default is whitespace characters).- string trimleft
string [chars] Return
stringwith leading characters from the setcharsremoved (default is whitespace characters).- string trimright
string [chars] Return
stringwith trailing characters from the setcharsremoved (default is whitespace characters).- string wordend
string index Return index of first character after ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access