insert method
Returns a copy of this
with other
inserted starting at index
.
Example:
'word'.insert('s', 0); // 'sword'
'word'.insert('ke', 3); // 'worked'
'word'.insert('y', 4); // 'wordy'
Implementation
String insert(String other, int index) => (StringBuffer()
..write(this.substring(0, index))
..write(other)
..write(this.substring(index)))
.toString();