Function strPrependLines

  • Prepend each line of a string with a specified string.

    Parameters

    • string: string

      The string to be processed.

    • toPrepend: string

      The string to prepend to each line.

    Returns string

    The processed string with each line prepended by the specified string.

    Example

    const myString = 'Hello\nWorld';
    strPrependLines(myString, '--');
    //=> '--Hello\n--World'

Generated using TypeDoc