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

Insert a String at a given location.

Signature

insert(index: Number, insert: String) => String

Description

The insert() method inserts insert at index in the source string.

The source string isn’t changed.

Parameters

Parameter Type Required Description

index

Number

Yes

Location to insert insert.

insert

String

Yes

String to insert at index in the source string.

Return value

Type Description

String

String with insert inserted at index in the source string.

Examples

'foo'.insert(0, 'bar')
"barfoo"

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!