Replace "\" with "/"
I have googled this issue but there is no an accurate answer for it.
I tried the codes below but it doesn't work due to "/" slash.
Can any1 suggest me a solution for this ? :)
String sPath= txtSample1.getText().replace('\','/');
Thanks and Regards,
Have you tried
String sPath= txtSample1.getText().replace("\\","/");
StringBuffer sb = new StringBuffer();
Pattern pattern = Pattern.compile("\\\\");
Matcher matcher = pattern.matcher(sPath);
It's early am, gotta go so sample code probably need work .....
Sorry for the late reply and thanks again masi for help and nicoloas too^^.
More fundamental question: Why do you want to do this? All known Java JVM's automatically handle it for you. There is no need to make this change.
Originally Posted by heartysnowy