Convert newlines to specified element

convertNewlines('Hello\nworld!') // 'Hello world!'
  • Parameters

    • string: string

      string to convert

    • replacement: string = ' '

      replacement to convert newlines to

    Returns string

    string with newlines converted to specified element