title: How to Clean Base64 File of Carriage Returns and Line feeds?
body: <p>I have a base64 file that needs to be cleaned of carriage returns and line feeds before it can get decoded into an image file. How do you clean it properly?</p>
  
  <p>Here's a portion of the text:</p>
  
  <p><a href="https://i.stack.imgur.com/GvZVc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GvZVc.png" alt="enter image description here"></a></p>
  
  <p>I tried removing all instances of <code>\n</code>, and <code>\r</code>, but when I decoded it, it seems that PNG file type is detected but the image is not displayed just some portions of the text file. I also tried cleaning with <code>\n, \r, \N</code>, and <code>\R</code> but it didn't work. I'm wondering if I'm missing out on something.</p>
  
  <p>Here's what I get when I decode it:
  <a href="https://i.stack.imgur.com/p3sKB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p3sKB.png" alt="enter image description here"></a></p>