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 Programmer Certification (SCJP/OCPJP) and the fly likes remove line feed and carriage return from a string 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 » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "remove line feed and carriage return from a string" Watch "remove line feed and carriage return from a string" New topic
Author

remove line feed and carriage return from a string

vydhehi paruchuri
Greenhorn

Joined: Aug 27, 2003
Posts: 22
Hi all:

How can we remove the line feed and carriage return from a string.

String str = "\r\n";

Thanks,

Vydhehi
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
I would use the replaceAll() method of String.


Mike Gershman
SCJP 1.4, SCWCD in process
 
wood burning stoves
 
subject: remove line feed and carriage return from a string
 
Similar Threads
how to clear/reset buffer when I use BufferedReader?
Newline Vs Carriage return
String assignment confusion
Stripping Carriage Returns
Please HELP Socket Amateur!