Advertisement

05.13.2008 at 02:12AM PDT, ID: 23397060
[x]
Attachment Details

replace in java String

Asked by feebie23 in Java Programming Language, Java Server Pages (JSP)

I have a String in the form of

<EMBED src='C:\Documents and Settings\dmadmin\Docu\Viewed\0906985f8000197c.pdf' height='490' width='1000'/>

In this String, I want to replace "C:\Documents and Settings\dmadmin" with "C:" so that the resultant Sting is
"<EMBED src='C:\Docu\Viewed\0906985f8000197c.pdf' height='490' width='1000'/>"

I am doing something like this

String dataString=sess.getAttribute("myEmbedString").toString(); //gets the comlete String
dataString = dataString.replaceAll("C:\\Documents and Settings\\dmadmin","C:");

But the value is not getting replaced. Please tell me how to sovle this issue.

ThanksStart Free Trial
[+][-]05.13.2008 at 02:16AM PDT, ID: 21553313

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Programming Language, Java Server Pages (JSP)
Sign Up Now!
Solution Provided By: ksivananth
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.13.2008 at 02:48AM PDT, ID: 21553452

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628