Function strRemoveNewLines

  • Removes all new line characters from a string.

    Parameters

    • string: string

      The string from which to remove new line characters.

    • replaceWith: string = ''

      The string to replace new line characters with. Default is an empty string.

    Returns string

    Example

    strRemoveNewLines('Hello\nWorld');;
    //=> 'HelloWorld'

    Example

    const str = 'Hello\nWorld';
    const result = strRemoveNewLines(str, ' ');
    console.log(result); // 'Hello World'

Generated using TypeDoc