1. 程式人生 > >擷取字串:指定字元間的擷取

擷取字串:指定字元間的擷取

String str = "United States' larg'es't";
String targetStr = str.replaceAll("\'", "\\\\'");
System.out.println("修改後:" + targetStr);
System.out.println("修改前:" + str);