Skip to main content

API Reference

Classes

String

String.

Methods

NameDescription
at
Returns the character at the specified index.
concat
Combines the text of two (or more) strings and returns a new string.
contains
Checks if string includes substring.
endsWith
Does this string end with the given searchString?
indexOf
Returns the index of the first occurrence of searchString found.
lowercase
Returns this string in lower case.
replace
Replaces the first occurrence of a substring within a string.
replaceAll
Replaces all occurrences of a substring within a string.
split
Splits string by separator.
startsWith
Does this string start with the given searchString?
substring
Returns a string between indexStart, indexEnd.
trim
Removes white spaces from start and end of this string.
uppercase
Returns this string in upper case.

at
at(index: num): str

Returns the character at the specified index.

indexRequired
  • Type: num

position of the character.


concat
concat(strN: str): str

Combines the text of two (or more) strings and returns a new string.

strNRequired
  • Type: str

one or more strings to concatenate to this string.


contains
contains(searchString: str): bool

Checks if string includes substring.

searchStringRequired
  • Type: str

substring to search for.


endsWith
endsWith(searchString: str): bool

Does this string end with the given searchString?

searchStringRequired
  • Type: str

substring to search for.


indexOf
indexOf(searchString: str): num

Returns the index of the first occurrence of searchString found.

searchStringRequired
  • 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.

searchStringRequired
  • Type: str

The substring to search for.


replaceStringRequired
  • Type: str

The replacement substring.


replaceAll
replaceAll(searchString: str, replaceString: str): str

Replaces all occurrences of a substring within a string.

searchStringRequired
  • Type: str

The substring to search for.


replaceStringRequired
  • Type: str

The replacement substring.


split
split(separator: str): MutArray<str>

Splits string by separator.

separatorRequired
  • Type: str

separator to split by.


startsWith
startsWith(searchString: str): bool

Does this string start with the given searchString?

searchStringRequired
  • Type: str

substring to search for.


substring
substring(indexStart: num, indexEnd?: num): str

Returns a string between indexStart, indexEnd.

indexStartRequired
  • Type: num

index of the character we slice at.


indexEndOptional
  • 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

NameDescription
fromJson
Parse string from Json.

fromJson
str.fromJson(json: Json, options?: JsonValidationOptions);

Parse string from Json.

jsonRequired

to create string from.


optionsOptional

Properties

NameTypeDescription
length
numThe length of the string.

lengthRequired
length: num;
  • Type: num

The length of the string.