Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

string.split()

Split a String at a provided separator.

Signature

split(separator: String) => Array<String>

Description

Splits the calling String at every occurrence of a provided separator. Returns an array of the resulting Strings.

The separator isn’t preserved in the results. The calling String isn’t changed.

Parameters

Parameter Type Required Description

separator

String

true

Separator to split the calling string[] at. Splits at every occurrence of the separator.

Return value

Type Description

Array<String>

Array of Strings resulting from the split. The separator isn’t preserved in the results.

Examples

'foobarbaz'.split('b')
[
  "foo",
  "ar",
  "az"
]

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!