Overview

Strings

static Strings :: {}

The Strings object contains many useful functions for manipulating and using the String datatype within Ruota.

Methods

Return Params Description
String replace(String s, Char a, Char b)

Replaces all instances of char a with char b within a given string.

Array split(String s, Char a = ' ', Number max = -1)

Splits a given string by a given char, returning an array of all substrings created by the split, up to a given maximum splits. If the max is -1, then the splits are unlimited.

String remove(String a, Char a)

Removes all instances of a given char.

String join(Array array, Char a = "")

Joins the values of an array into a single string, delineated by a given char.

Number find(String s, String pat)

Searches across a string for the first instance of a given pattern, returning the index of the first char in that match. If no match is found, then the function returns -1.

Array findAll(String s, String pat)

Searches across a string for all instances of a given pattern, returning the indices of the first char in those matches. If no match is found, then the function returns an empty array.

String toUpper(String s)

Converts a string to uppercase.

String toLower(String s)

Converts a string to lowercase.