When we use File.getAbsolutePath() we get the path of file as C:\BlahBlah\Blah.txt. But I want the path name as C:/BlahBlah/Blah.txt i.e instead of backward slash "\" i want a forward slash "/" in the path. How to get this. I tried to create a parsefile method.
public String parsePath(String path)
{
String parsedString="";
String[] arr = path.split("\ ");
System.out.println(arr.length);
for(int i=0;i<arr.length-1;i++)
parsedString=arr[i]+"/";
parsedString=parsedString+arr[arr.length-1];
return parsedString;
}
But it gives illegal space character
String[] arr = path.split("\");
What should I do?