Untitled
public text v1 · immutable String currentPath = System.getProperty("user.dir");
System.out.println(currentPath);
char[] tempChar = currentPath.toCharArray();
for(int i = 0; i < tempChar.length; i++) {
if(tempChar[i] == '\\') {
tempChar[i] = '/';
}
}
System.out.println(currentPath);
output:
C:\Documents and Settings\tore-\workspace\Prosjekt
C:\Documents and Settings\tore-\workspace\Prosjekt