| Author |
Stripping Out Carriage Returns
|
Steve Dyke
Ranch Hand
Joined: Nov 16, 2004
Posts: 1254
|
|
Why would the following code not take out the carriage returns and line feeds?
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Are you not asking it to replace only where there is a carriage return followed by a line break (plus I think you will need to escape the regex escape character)? This does it I think: [ May 08, 2008: Message edited by: Paul Sturrock ]
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18670
|
|
Or perhaps str.replaceAll("[\\r\\n]+", "");
|
"I'm not back." - Bill Harding, Twister
|
 |
 |
|
|
subject: Stripping Out Carriage Returns
|
|
|