Hi,

I'm looking for an effient method (literally a Java method) to escape
quotes and backslashes in a string. I need this to fix a bug in JDEbug. The
method should do the following:

1) Search for all occurences of \ in a string and replace them with \\.

2) Search for all occurences of " in a string and replace them with \".

Note that step 1 needs to be done first to avoid escaping the escapes for
the quotation marks.

JDEBug currently has a method that uses a simple-minded approach that
builds the output string by concatenating it with each character of the
input string or \" in the case of quote marks in the input string.

If any of you have a spare moment and would like to take a stab at doing
this more efficiently (e.g., with fewer object creations), I'd greatly
appreciate it.

- Paul



------------------------------------------------------------
JDE mailing list archive: 
http://www.mail-archive.com/[email protected]/maillist.html

If you have a problem with the JDE, please use JDE->Help->Submit Problem
Report to prepare your query. This will insure that you include all
information that may be required to solve your problem.

Reply via email to