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

Stripping Carriage Returns

 
Steve Dyke
Ranch Hand
Posts: 1642
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I strip the carriage returns and line feeds on this line on code?

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Steve Dyke
Ranch Hand
Posts: 1642
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The text set to the session:

dwgeffectivity.getMiscString()
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic