Skip to main content

API Reference

Classes

String

String.

Methods

NameDescription
atReturns the character at the specified index.
concatCombines the text of two (or more) strings and returns a new string.
containsChecks if string includes substring.
endsWithDoes this string end with the given searchString?
indexOfReturns the index of the first occurrence of searchString found.
lowercaseReturns this string in lower case.
replaceReplaces the first occurence of a substring within a string.
replaceAllReplaces all occurrences of a substring within a string.
splitSplits string by separator.
startsWithDoes this string start with the given searchString?
substringReturns a string between indexStart, indexEnd.
trimRemoves white spaces from start and end of this string.
uppercaseReturns 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 occurence 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
fromJsonParse string from Json.

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

Parse string from Json.

jsonRequired

to create string from.


optionsOptional

Properties

NameTypeDescription
lengthnumThe length of the string.

lengthRequired
length: num;
  • Type: num

The length of the string.