Solved

Escape special characters in Java

Posted on 2007-03-30
2
1,884 Views
Last Modified: 2008-01-09
Hi,

I forming a string with a lot of characters that I need to escape, for example


String newStr = new String("\Hi, """ This is \\//complex string");

What I'm looking is there a function I can call to escape the the string automaticlly?

thanks.
0
Comment
Question by:yarock
2 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 18823958
Which ones?
0
 
LVL 11

Accepted Solution

by:
Manish earned 500 total points
ID: 18824106
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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 …

757 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

22 Experts available now in Live!

Get 1:1 Help Now