Solved

Replacing the text from string

Posted on 2007-03-28
3
178 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 …

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now