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.
I have tried this code for testing.
<cfset str = "a#chr(10)#bc#chr(13)#def#chr(9)#fg">
<cfset cleanedStr = reReplace(str,"#chr(13)##chr(10)#","","ALL")>
<cfset cleanedStr = reReplace(str,"#chr(10)#","","ALL")>
<cfset cleanedStr = reReplace(str,"#chr(13)#","","ALL")>
<cfset cleanedStr = reReplace(str,"#chr(9)#","","ALL")>
<cffile action="write" file="D:/projects/test.txt" output="#cleanedStr#">
But when I open the file in Eclipse, it still shows the linefeed and cariage return characters.
So what's the correct way to remove these characters?