Slicing & Splitting
Last updated
Methods that extract parts of a string or break it into an array.
.left(n) → stringThe first n characters.
.right(n) → stringThe last n characters.
log "Hello".left(2) // "He"
log "Hello".right(2) // "lo".split(delim) → arraySplits the string on delim into an array of substrings.
log "a,b,c".split(",") // ["a", "b", "c"].toArr() → arraySplits the string into an array of single-character strings.
log "abc".toArr() // ["a", "b", "c"]Last updated