• Insert a string into another string at a given position

    Parameters

    • target: string

      Parent string you want to modify

    • str: string

      Value that will be injected to parent

    • index: number

      Position to inject string at

    Returns String

    • New string
    console.log(insertAt('Hello world!', ' glorious', 5);
    // Output: Hello glorious world!

    use strSplice()