This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes carriage return replace in string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "carriage return replace in string" Watch "carriage return replace in string" New topic
Author

carriage return replace in string

Chris Reeves
Ranch Hand

Joined: Apr 03, 2002
Posts: 95
I need to replace end of line characters ('\n') with html breaks (br).
However, I'm stuck using jdk 1.3.1, so I don't have the luxury of regex.
Any quick and dirty low tech ideas out there?
Chris
Chris Reeves
Ranch Hand

Joined: Apr 03, 2002
Posts: 95
Must be a low brain power day - I solved my issue as I posted it.
I just move the string to a string buffer, in which I can do the replace, then do toString for output.
Thanks for listening.
Chris
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
No problem . Glad we could be so helpful .


"JavaRanch, where the deer and the Certified play" - David O'Meara
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
This has been another episode of JavaRanch playing the role of the Cardboard Analyst.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: carriage return replace in string
 
Similar Threads
compating strings using ==
how to replace eol and nl
embedding html in servlets
Replace Double Quote and Single Quotes
setting attributes in the scopes