Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java_remove last char

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;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #char
ADD COMMENT
Topic
Name
1+1 =