Static p5_sys::global::splitTokens[][src]

pub static splitTokens: SplitTokensInternalType
Expand description

The splitTokens() function splits a String at one or many character delimiters or "tokens." The delim parameter specifies the character or characters to be used as a boundary.

If no delim characters are specified, any whitespace character is used to split. Whitespace characters include tab (\t), line feed (\n), carriage return (\r), form feed (\f), and space.

Examples

function setup() {
  let myStr = 'Mango, Banana, Lime';
  let myStrArr = splitTokens(myStr, ',');

  print(myStrArr); // prints : ["Mango"," Banana"," Lime"]
}

Parameters

value the String to be split

delim? list of individual Strings that will be used as separators