API Reference
Classes
String
String.
Methods
Name | Description |
---|---|
| Returns the character at the specified index. |
| Combines the text of two (or more) strings and returns a new string. |
| Checks if string includes substring. |
| Does this string end with the given searchString? |
| Returns the index of the first occurrence of searchString found. |
| Returns this string in lower case. |
| Replaces the first occurrence of a substring within a string. |
| Replaces all occurrences of a substring within a string. |
| Splits string by separator. |
| Does this string start with the given searchString? |
| Returns a string between indexStart, indexEnd. |
| Removes white spaces from start and end of this string. |
| Returns this string in upper case. |
at
at(index: num): str
Returns the character at the specified index.
index
Required
- Type: num
position of the character.
concat
concat(strN: str): str
Combines the text of two (or more) strings and returns a new string.
strN
Required
- Type: str
one or more strings to concatenate to this string.
contains
contains(searchString: str): bool
Checks if string includes substring.
searchString
Required
- Type: str
substring to search for.
endsWith
endsWith(searchString: str): bool
Does this string end with the given searchString?
searchString
Required
- Type: str
substring to search for.
indexOf
indexOf(searchString: str): num
Returns the index of the first occurrence of searchString found.
searchString
Required
- Type: str
substring to search for.
lowercase
lowercase(): str
Returns this string in lower case.
replace
replace(searchString: str, replaceString: str): str
Replaces the first occurrence of a substring within a string.
searchString
Required
- Type: str
The substring to search for.
replaceString
Required
- Type: str
The replacement substring.
replaceAll
replaceAll(searchString: str, replaceString: str): str
Replaces all occurrences of a substring within a string.
searchString
Required
- Type: str
The substring to search for.
replaceString
Required
- Type: str
The replacement substring.
split
split(separator: str): MutArray<str>
Splits string by separator.
separator
Required
- Type: str
separator to split by.
startsWith
startsWith(searchString: str): bool
Does this string start with the given searchString?
searchString
Required
- Type: str
substring to search for.
substring
substring(indexStart: num, indexEnd?: num): str
Returns a string between indexStart, indexEnd.
indexStart
Required
- Type: num
index of the character we slice at.
indexEnd
Optional
- Type: num
optional - index of the character we end slicing at.
trim
trim(): str
Removes white spaces from start and end of this string.
uppercase
uppercase(): str
Returns this string in upper case.
Static Functions
Name | Description |
---|---|
| Parse string from Json. |
fromJson
str.fromJson(json: Json, options?: JsonValidationOptions);
Parse string from Json.
json
Required
- Type: Json
to create string from.
options
Optional
- Type: JsonValidationOptions
Properties
Name | Type | Description |
---|---|---|
| num | The length of the string. |
length
Required
length: num;
- Type: num
The length of the string.