Reference

String

Constructor
Input A text surrounded by single or double quotes.
Output A string containing the text.

Signature

Example

Indexing
Input A string and a number representing the index.
Output The character at the specified index.

Signature

Example

Substring
Input A string and two numbers representing the start and end indices.
Output The substring from the start index to the end index.

Signature

Example

Starts with
Input Two strings.
Output True if the first string starts with the second string. False otherwise.

Signature

Example

Ends with
Input Two strings.
Output True if the first string ends with the second string. False otherwise.

Signature

Example

Replace
Input A string and two substrings.
Output A new string with all occurrences of the first substring replaced by the second substring.

Signature

Example

Uppercase
Input A string.
Output A new string converted to uppercase.

Signature

Example

Lowercase
Input A string.
Output A new string converted to lowercase.

Signature

Example

Trim
Input A string.
Output A new string with leading and trailing whitespace removed.

Signature

Example

Match
Input A string and a regex pattern.
Output True if the string matches the regex pattern. False otherwise.

Signature

Example

Length
Input A string.
Output The length of the string.

Signature

Example

Concat
Input Two strings.
Output The concatenation of the two strings.

Signature

Example

First
Input A string.
Output The first character of the string.

Signature

Example

Last
Input A string.
Output The last character of the string.

Signature

Example

Init
Input A string.
Output A new string without its last character.

Signature

Example

Rest
Input A string.
Output A new string without its first character.

Signature

Example

At
Input A string and a number representing the index.
Output The character at the specified index.

Signature

Example

Is empty
Input A string.
Output True if the string is empty. False otherwise.

Signature

Example

Is not empty
Input A string.
Output True if the string is not empty. False otherwise.

Signature

Example

Contains
Input A string and an argument of any type.
Output True if the string contains the argument. False otherwise.

Signature

Example

Take
Input A string and a number representing the number of characters.
Output The first n characters of the string.

Signature

Example

Drop
Input A string and a number representing the number of characters.
Output A new string without the first n characters.

Signature

Example

Remove at
Input A string and a number representing the index.
Output A new string with the character at the specified index removed.

Signature

Example

Reverse
Input A string.
Output A new string with its characters in reverse order.

Signature

Example

Bytes
Input A string.
Output A list of the string's bytes.

Signature

Example

Index of
Input A string and any value.
Output The index of the first occurrence of the value in the string, or -1 if the value is not found.

Signature

Example

Pad left
Input A string, a number representing the minimum length, and a string to pad with.
Output A new string padded on the left with the specified padding.

Signature

Example

Pad right
Input A string, a number representing the minimum length, and a string to pad with.
Output A new string padded on the right with the specified padding.

Signature

Example

Split
Input A string and a separator string.
Output A list of the string's substrings separated by the separator.

Signature

Example

Compare
Inputs Two strings.
Output 1 if the first string is bigger than the second. -1 if it is the smaller. 0 if they are equal.

Signature

Example