Get file separator symbol in Java
Description
The following code shows how to get file separator symbol.
Example
//from www. j a va 2 s. c o m
public class Main {
public static void main(String[] args) {
String dataFolder = System.getProperty("user.dir") + System.getProperty("file.separator")
+ "data";
System.out.println("Data Folder = " + dataFolder);
}
}
The code above generates the following result.