public static String noX(String str) {
String result = "";
if (str == null || str.trim().length() == 0)
return result;
String c = str.substring(0, 1);
str = str.substring(1);
if (!(c.equals("x"))) {
result = c;
}
return result + noX(str);
}
String result = "";
if (str == null || str.trim().length() == 0)
return result;
String c = str.substring(0, 1);
str = str.substring(1);
if (!(c.equals("x"))) {
result = c;
}
return result + noX(str);
}
No comments:
Post a Comment