第1个回答 2010-10-12
写个方法:
public class Test {
public static void main(String[] args) {
String ss = "s/s/s";
while (ss.indexOf("/") != -1) {
ss = change(ss);
}
System.out.println(ss);
}
public static String change(String ss) {
return ss.substring(0, ss.indexOf("/")) + "\\"
+ ss.substring(ss.indexOf("/") + 1, ss.length());
}
}