Stay organized with collections
Save and categorize content based on your preferences.
strings.split
strings.split(string, delimiter)
Description
Splits string value using the delimiter argument. The default delimiter is a
comma (,
).
Param data types
STRING
, STRING
Return type
ARRAY_STRINGS
Code samples
Example 1
The following example splits the string using the default delimiter, which is a
comma.
strings.split("a,b,c,d") = ["a", "b", "c", "d"]
Example 1
The following example splits the string at each colon (:
).
strings.split("a:b:c:d", ":") = ["a", "b", "c", "d"]
Example 2
The following example is missing the delimiter in the string value.
strings.split("a,b,c,d", ":") = ["a,b,c,d"]
Example 3
The following example has an empty delimiter string.
strings.split("abc", "") = ["a", "b", "c"]
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-14 UTC."],[[["`strings.split` is a function that divides a string into an array of strings based on a specified delimiter."],["The default delimiter for `strings.split` is a comma (,), but it can be changed to any other string."],["If the specified delimiter is not found within the string, `strings.split` returns the original string as a single-element array."],["When an empty string is used as the delimiter, `strings.split` splits the original string into individual characters."],["The function `strings.split` is supported within Rules and Search."]]],[]]