This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Stripping Carriage Returns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Stripping Carriage Returns" Watch "Stripping Carriage Returns" New topic

Stripping Carriage Returns

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
How can I strip the carriage returns and line feeds on this line on code?

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60804

I do not know what you are asking? On the line of code in an editor? The text set into the session? Other?

Please read this.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
The text set to the session:

marc weber

Joined: Aug 31, 2004
Posts: 11343

Check the String class for replacement methods, and note the following escape sequences...

\n is a new line
\f is a form feed
\r is a carriage return

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Stripping Carriage Returns
Similar Threads
How do I find a text file is Unix or Dos format via Java API?
How to avoid IllegalStateException (Response Already Commited )
Stripping Out Carriage Returns
Carriage Return?????????
Clear Windows Console....