Henry Wong wrote:
rajesh vass wrote:Hi guys,
I AM TRYING TO REPLACE THE BACKSLASH(\) WITH (\\) IN THE STRING BELOW
C:\Program Files\Yahoo!\Messenger\Profiles\
I AM UNABLE TO DO...SO PLEASE HELP ME...........
THANKS IN ADVANCE
Well, what have you tried? Have you tried the replace() method? BTW, you do know that strings are immutable, and that the best you can do is create a new string (with replaced values), right?
Henry
THIS IS THE PART OF CODE
yahooBasePath=properties.getProperty("YAHOOBASEPATH");
yahooBasePath1=properties.getProperty("YAHOOBASEPATH");
String[] tokens = yahooBasePath1.split("\\");
System.out.println(tokens[0]);
try
{
int len = tokens.length;
String url;
for (int i = 0; i <len; i++)
{
System.out.println(tokens[0] + tokens[len]);
url = tokens[i] + "\\\\";
}
System.out.println("url");
System.out.println("Propety Read :" + yahooBasePath);
}
catch (Exception e) { }