I want to replace backslash (\) with forwordslash(/) in my program, any help is on this is most welcomed,
my code snippest is as fallows:
//capturing the input from user form and storing it in to "tempimage" a string var,
String tempimage = request.getParameter("file");
// replacing all backslash(\) character with forword slash (/)
String image=tempimage.replaceAll("\","/" );
facing problem with compiler, i want to know that how to use escape char's in a java code ...
Thanx to all of you in advance, for reading my question and trying to help me.
regards
-rai000
2 Replies - 1745 Views - Last Post: 14 June 2008 - 05:36 AM
#1
need help on "How To use Escape characters" in servlets
Posted 14 June 2008 - 01:51 AM
Replies To: need help on "How To use Escape characters" in servlets
#2
Re: need help on "How To use Escape characters" in servlets
Posted 14 June 2008 - 02:02 AM
[rules]
[/rules]
Hello.. and be more specific.. more informative as possible..
..lmao..
[/rules]
Hello.. and be more specific.. more informative as possible..
This post has been edited by mensahero: 14 June 2008 - 02:03 AM
#3
Re: need help on "How To use Escape characters" in servlets
Posted 14 June 2008 - 05:36 AM
You must escape the backslash in Java String literals with a backslash, so the correct syntax is: String image=tempimage.replaceAll("\\","/" );
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|