string
Methods on every string.
Functions
| clone | clone(): any | Returns str itself. |
| concat | pure string.concat(value, ...): any | Joins its arguments into one string, with str between each pair. |
| constructor | constructor(value): any | Converts value to a string. This is what runs when types.String itself is called, types.String(value), the same way types.Integer(value) converts to an integer. |
| contains | pure string.contains(substr: string, [start: number], ...): any | Returns whether str contains substr. |
| endswith | string.endswith(suffix: string): any | Returns whether str ends with suffix. |
| escape | string.escape(): any | Returns str with backslash, the two quote characters, and every non-printable-ASCII byte replaced by an escape sequence. |
| hash | pure string.hash(): any | Returns str's hash. |
| hasindex | pure string.hasindex(index: number, ...): any | Returns whether index is a valid byte position in str. |
| indexof | pure string.indexof(substr: string, [start: number], ...): any | Returns the byte index of the first occurrence of substr in str. |
| join | pure string.join(arr: array, [filter: bool|function], ...): any | Joins the items of arr into one string, with str between each pair. |
| len | pure string.len(): any | Returns the length of str in bytes. |
| lstrip | string.lstrip(): any | Returns str with white space removed from the beginning only. |
| replace | pure string.replace(from: string, to: string): any | Returns str with every occurrence of from replaced by to. |
| rstrip | string.rstrip(): any | Returns str with white space removed from the end only. |
| slice | pure string.slice([start: number, end: number], ...): any | Returns the bytes of str from start up to, but not including, end. |
| split | pure string.split([separator: string], ...): any | Splits str into an array of strings. |
| split_by_chars | string.split_by_chars(separators: string, [skip_empty: bool], ...): any | Splits str into an array of strings at every byte that occurs in separators. |
| startswith | string.startswith(prefix: string): any | Returns whether str begins with prefix. |
| strip | string.strip(): any | Returns str with white space removed from both ends. |
| subst | pure string.subst(value, ...): any | Substitutes {0}, {1}, ... and {name} placeholders in str with the given values. |
| tofloat | pure string.tofloat(): any | Parses str as a float. |
| tointeger | pure string.tointeger([base: number], ...): any | Parses str as an integer. |
| tolower | pure string.tolower([start: number, end: number], ...): any | Returns a copy of str with the ASCII letters in [start, end) lowercased. |
| tostring | pure tostring(): any | Returns str itself. |
| toupper | pure string.toupper([start: number, end: number], ...): any | Returns a copy of str with the ASCII letters in [start, end) uppercased. |
| weakref | weakref(): any | Returns a weak reference to str. |