We would like to know how to escape string as directory name.
import java.io.File; //w ww .ja v a 2 s . c om public class Main { public static void main(String[] args) { File f = new File("c:\\MyFolder"); System.out.println(f); } }
The code above generates the following result.