Skip to content

String

We can use double quotes " and ` to create a string literal.

nvs

String Interpolation

We can use ${} to interpolate a expression into a string, you must use backticks ` to create a string literal.

nvs

Methods

to_number

Convert a string to a number.

nvs

to_lowercase

Convert a string to lowercase.

nvs

to_uppercase

Convert a string to uppercase.

nvs

substring

Get a substring from a string.

nvs

replace

Replace all matches substring in a string.

nvs

len

Return number of chars in a string.

nvs

contains

Check if a string contains a substring.

nvs

starts_with

Check if a string starts with a substring.

nvs

ends_with

Check if a string ends with a substring.

nvs

split

Split a string into a list of strings.

nvs

trim

Trim whitespace from the start and end of a string.

nvs

trim_start

Trim whitespace from the start of a string.

nvs

trim_end

Trim whitespace from the end of a string.

nvs

insert

Deprecated, this will remove.

Insert a string to this String at a byte offset and returns a new string.

nvs

push

Deprecated, this will remove.

Push a string to this String at the end and returns a new string.

nvs