augment-vir - v32.1.0
    Preparing search index...

    Function replaceStringAtIndex

    • 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.

      Parameters

      • __namedParameters: Readonly<
            {
                length?: number;
                original: string;
                replacement: string;
                start: number;
            },
        >

      Returns string

      import {replaceStringAtIndex} from '@augment-vir/common';

      replaceStringAtIndex({original: 'eat the waffles', start: 4, replacement: 'his'}); // outputs `'eat his waffles'`
      replaceStringAtIndex({original: 'eat the waffles', start: 4, replacement: 'my', length: 3}); // outputs `'eat my waffles'`