Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

remove line feed and carriage return from a string

 
vydhehi paruchuri
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would use the replaceAll() method of String.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic