Split

The split function separates a string into a list of substrings based on a specified delimiter.

Parameters

  • string: Required. The string to be split.
  • delimiter: Required. The character or string that separates the substrings in the string.

Examples

split("Hello, World!", delimiter=",")

Returns: ["Hello", " World!"]

split("1,2,3,4,5", delimiter=",")

Returns: ["1", "2", "3", "4", "5"]

split("A B C D E", delimiter=" ")

Returns: ["A", "B", "C", "D", "E"]