title: how to remove \r and \n from my string in java?
body: <p>I'm just trying to remove (replace with "") \r and \n from my JSON. Here is the method I'm currently testing which doesn't work.</p>
  
  <pre><code>    public static void testing(){
          String string = "\r\r\r\n\n\n";
          string.replace("\r", "");
          string.replace("\n", "");
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/UiYBF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UiYBF.png" alt="enter image description here"></a></p>