Replaces whatever substring is at the given index in the original string with the new string. Optionally, provide a length of the substring to get replaced.
import {replaceStringAtIndex} from '@augment-vir/common';replaceStringAtIndex('eat the waffles', 4, 'his'); // outputs `'eat his waffles'`replaceStringAtIndex('eat the waffles', 4, 'my', 3); // outputs `'eat my waffles'` Copy
import {replaceStringAtIndex} from '@augment-vir/common';replaceStringAtIndex('eat the waffles', 4, 'his'); // outputs `'eat his waffles'`replaceStringAtIndex('eat the waffles', 4, 'my', 3); // outputs `'eat my waffles'`
@augment-vir/common
Replaces whatever substring is at the given index in the original string with the new string. Optionally, provide a length of the substring to get replaced.