Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

remove last character from string java

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);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #character #string #java
ADD COMMENT
Topic
Name
3+4 =