Add string::split().

This commit is contained in:
Stephen Chung
2020-09-25 23:02:49 +08:00
parent da9aa60256
commit 4efe6b90e7
3 changed files with 39 additions and 7 deletions

View File

@@ -16,6 +16,7 @@ using a [raw `Engine`]) operate on [strings]:
| `contains` | character/sub-string to search for | checks if a certain character or sub-string occurs in the string |
| `index_of` | character/sub-string to search for, start index _(optional)_ | returns the index that a certain character or sub-string occurs in the string, or -1 if not found |
| `sub_string` | start index, length _(optional)_ | extracts a sub-string (to the end of the string if length is not specified) |
| `split` | delimiter character/string | splits the string by the specified delimiter, returning an [array] of string segments |
| `crop` | start index, length _(optional)_ | retains only a portion of the string (to the end of the string if length is not specified) |
| `replace` | target character/sub-string, replacement character/string | replaces a sub-string with another |
| `trim` | _none_ | trims the string of whitespace at the beginning and end |