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.splitAt()

Split a String at the given index.

Signature

splitAt(index: Number) => Array

Description

The splitAt() method splits the input string at index and returns a list of strings.

The input string isn’t changed.

Parameters

Parameter Type Required Description

index

Number

Yes

Location in input string to split the string.

Return value

Type Description

Array

Array of strings.

Examples

'foobar'.splitAt(3)
[
  "foo",
  "bar"
]

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!