Static p5_sys::global::split[][src]

pub static split: SplitInternalType
Expand description

The split() function maps to String.split(), it breaks a String into pieces using a character or string as the delimiter. The delim parameter specifies the character or characters that mark the boundaries between each piece. A String[] array is returned that contains each of the pieces.

The splitTokens() function works in a similar fashion, except that it splits using a range of characters instead of a specific character or sequence.

Examples

let names = 'Pat,Xio,Alex';
let splitString = split(names, ',');
text(splitString[0], 5, 30);
text(splitString[1], 5, 50);
text(splitString[2], 5, 70);

Parameters

value the String to be split

delim the String used to separate the data