title: How to remove line breaks in string?
body: <p>This is my code:</p>
  
  <pre><code>process.stdin.resume();
  process.stdin.setEncoding('utf8');
  
  process.stdin.on('data', function (text) {
      text.replace(/\r?\n|\r/g, "");
      console.log("Command: " + text + "textthatshouldbeinthesameline");
      if (text == 'quit') {
          console.log("Quitting");
          done();
      }
  });
  
  function done() {
    console.log('Now that process.stdin is paused, there is nothing more to do.');
    process.exit();
  }
  </code></pre>
  
  <p>And this is what happens:</p>
  
  <p><img src="https://i.stack.imgur.com/wNWTI.png" alt="enter image description here"></p>
  
  <p>It seems like there are some line breaks, I tried to replace them, but as you see: without effect.</p>
  
  <p>When I type "quit" it also isn't recognized by if statement.</p>