This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Getting MEAN with Mongo, Express, Angular, and Node and have Simon Holmes 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

JavaRanch » Java Forums » Java » Java in General
Bookmark "carriage return replace in string" Watch "carriage return replace in string" New topic

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 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.
Cindy Glass
"The Hood"

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

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]
Don't get me started about those stupid light bulbs.
subject: carriage return replace in string