Solved

Replacing the text from string

Posted on 2007-03-28
3
209 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

688 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