String s = "Hello Worlds";
String end = "";
end = s.substring((0, s.length()-1));
private static String removeLastChar(String str) {
return str.substring(0, str.length() - 1);
}
str = str.substring(0, str.length() - 1);
public static String removeLastCharacter(String str) {
String result = null;
if ((str != null) && (str.length() > 0)) {
result = str.substring(0, str.length() - 1);
}
return result;
}
String s = "Hello Worlds";
String end = "";
end = s.substring((0, s.length()-1));
public static String removeLastChar(String str) {
return removeLastChars(str, 1);
}
public static String removeLastChars(String str, int chars) {
return str.substring(0, str.length() - chars);
}
public String method(String str) {
if (str.charAt(str.length()-1)=='x'){
str = str.replace(str.substring(str.length()-1), "");
return str;
} else{
return str;
}
}
buggy_name = 'GeekflareE'
name = buggy_name[:-1]
my_str = "abcdefghij"
my_str = my_str[:-1]
String TEST_STRING = "abcdef";
StringUtils.substring(TEST_STRING, 0, TEST_STRING.length() - 1);