i read a string from my csv file like below
BenFeature = fieldSet.readString("ben_feature").replaceAll("\r\n","\n");
the text from my file ben_feature = "Testing \r\n working \r\n"
expecting to be in next like like below
Testing
working
but the out put still have \r\n.
but when i use dummy string
String testing = "Testing \r\n Working \r\n";
testing = testing.replaceAll("\r\n","\n")
this works perfectly.
is the fieldSet.readString is the issue?
You're saying that
the text from my file ben_feature = "Testing \r\n working \r\n"which makes me assume that your text actually contains the\r\nas text. So instead of the control symbols for carriage return and line feed there is a character\followed by a characterrand so on. That will not be picked up by your replace.If you want to convert these occurences into actual
\nyou would have to escape the\like this:\\.So your code should then read