2
我碰到過這個小問題。java用其他字符替換筆畫
String fileAdress = "c:\red\";
System.out.println("Peach " + fileAdress);
fileAdress = fileAdress.replaceAll("\", "\\\\");
System.out.println("Steel " + fileAdress);
或
String fileAdress = "c:\\red\\";
System.out.println("Peach " + fileAdress);
fileAdress = fileAdress.replaceAll("\\", "\\\\");
System.out.println("Steel " + fileAdress);
我想給fileAddress轉換到以下
String fileAdress = "c:\\\\red\\\\";
是否可以告知我在哪裏做的錯誤,以及如何解決它?