title: How to remove linefeed, carriage return and tabs from a string in ColdFusion?
body: <p>I have a requirement to write strings to text files, but before that I need to ensure that the string does not contain any linefeed, carriage return, or tab characters.</p>
  
  <p>I have tried this code for testing.</p>
  
  <pre><code>&lt;cfset str = "a#chr(10)#bc#chr(13)#def#chr(9)#fg"&gt;
  &lt;cfset cleanedStr = reReplace(str,"#chr(13)##chr(10)#","","ALL")&gt;
  &lt;cfset cleanedStr = reReplace(str,"#chr(10)#","","ALL")&gt;
  &lt;cfset cleanedStr = reReplace(str,"#chr(13)#","","ALL")&gt;
  &lt;cfset cleanedStr = reReplace(str,"#chr(9)#","","ALL")&gt;
  
  &lt;cffile action="write" file="D:/projects/test.txt" output="#cleanedStr#"&gt;
  </code></pre>
  
  <p>But when I open the file in Eclipse, it still shows the linefeed and cariage return characters.</p>
  
  <p><img src="https://i.stack.imgur.com/fUc9v.png" alt="Text Editor image"></p>
  
  <p>So what's the correct way to remove these characters?</p>