splitTokens(str, [tokens])

The splitTokens() function splits a string at one or many character “tokens.” The tokens parameter specifies the character or characters to be used as a boundary.

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

Type: function

Parameter(s):

  • str {String}:

    the String to be split

  • tokens {String} Optional:

    list of individual characters that will be used as separators

Returns:

  • {Array}:

    Array of strings