File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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]
Consider Paul's rocket mass heater.
subject: carriage return replace in string