?
Solved

Replacing the text from string

Posted on 2007-03-28
3
Medium Priority
?
214 Views
Last Modified: 2010-03-31
Hi,

I am using JDK 1.5

In my string where I have line breaks, when I reload it the line breaks go away

Can I find In my string that there are how many line breaks in the string and can I replace all of my line breaks with the string  


Can someone help me with the small piece of code

Many Thanks
0
Comment
Question by:dinesh_bali
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Expert Comment

by:Jaax
ID: 18806750
Try
String str = "YourString";
str = str.replace("[\n\r\f]", "&#10");
0
 
LVL 10

Accepted Solution

by:
Jaax earned 2000 total points
ID: 18806754
Sorry the method should have been replaceAll
0
 

Author Comment

by:dinesh_bali
ID: 18807238
Thanks, I will come back to you
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
A solution for Fortify Path Manipulation.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month10 days, 17 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question