Skip to main content
Version: Next

String Split

Divide a string into an ordered list of substrings

Description

The split method takes a String and breaks it into a list of smaller parts, placing these parts into an array, which it then returns. This division is based on a specified pattern provided as the method's first parameter.

By default, the method includes all possible divisions, with the limit set to -1, meaning none are excluded. If you set the limit to zero, the result will be an empty list.

Inputs

  • input (String): The string to divide
  • pattern (String): The pattern to look for
  • limit (Number): A value used to limit the number of elements returned in the list

Outputs

  • result (Array): The ordered list of substrings