ar5

insert()

Description

insert() takes in a string, and index, and a character, and inserts the character into the string at the given index.

Syntax

insert(str, index, value)

str: The string where that value will be inserted into

index: The index of str where value will be inserted

value: The character that is being inserted into str

Returns

A new string that has been modified.

Example

insert('laughter', 0, 's')

output:
'slaughter'