I\'ve little knowledge of Java. I need to construct a string representation of an URI from FilePath(String) on windows. Sometimes the inputFilePath
class TestPath {
public static void main(String[] args) {
String brokenPath = "file:/C:/a.txt";
System.out.println(brokenPath);
if (brokenPath.startsWith("file:/")) {
brokenPath = brokenPath.substring(6,brokenPath.length());
}
System.out.println(brokenPath);
}
}
Gives output:
file:/C:/a.txt
C:/a.txt
Press any key to continue . . .