String Module
This module provides functions for manipulating str types. Note that strings in solus can be concatenated using the same + operator as any other value, which is why there is no string.cat(a, b)!
string.len
string.len(string: str) -> i64
Returns the length of a string
Parameters
| Parameter | Type | Description |
|---|---|---|
string | str | String to find length of |
string.sub
string.sub(string: str, start: i64, end: i64) -> str
Returns a substring using the specified start and end. End must not be before start, and both indices are clamped
Parameters
| Parameter | Type | Description |
|---|---|---|
string | str | String to slice |
start | i64 | Starting index (zero-based) |
end | i64 | Ending index |
string.repeat
string.repeat(string: str, count: i64) -> str
Repeats a string count amount of times
Parameters
| Parameter | Type | Description |
|---|---|---|
string | str | String to repeat |
count | i64 | Amount of times to repeat string |
string.join
string.join(strings: obj) -> str
Joins an array of strings into a single str
Parameters
| Parameter | Type | Description |
|---|---|---|
strings | obj | An array of strings |
string.split
string.split(string: str, delim: str) -> obj
Splits a str into an array of strings separated by a delimiter
Parameters
| Parameter | Type | Description |
|---|---|---|
string | str | String to split apart |
delim | str | Separator to split at |
