String
Overview
A String value natively represents a sequence of text. Characters may consist of multiple codepoints, which has a
length denoted by the .size method and a .bytes method for the underlying length.
Fields
.slice
fn (start?: Number, end?: Number) -> StringCreates a section of a String indicated by a given range.
.contains
fn (needle: String, index?: Number) -> NumberDetermines if a String contains a matching needle value.
.starts_with
fn (needle: String) -> BooleanDetermines if a String starts with a matching needle value.
.pad_leading
fn (length: Number, padding?: String) -> StringPads a String shorter than the length with a given padding from the left.
.pad_trailing
fn (length: Number, padding?: String) -> StringPads a String shorter than the length with a given padding from the right.