Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Delete end element in string java

public String method(String str) {
    if (str != null && str.length() > 0 && str.charAt(str.length() - 1) == 'x') {
        str = str.substring(0, str.length() - 1);
    }
    return str;
}
Source by coderoad.ru #
 
PREVIOUS NEXT
Tagged: #Delete #element #string #java
ADD COMMENT
Topic
Name
2+9 =