List of utility methods to do String Trim Right
String | rtrim(String str) Right trim of a given String int len = str.length(); char[] val = str.toCharArray(); int count = len; while (len > 0 && (val[len - 1] <= ' ')) { len--; return (len < count) ? str.substring(0, len) : str; |
String | rTrim(String str) Remove trailing whitespace of the specified string using expressions. return str.replaceAll("\\s+$", ""); |
String | rtrim(String str, String charList) rtrim int end = str.length() - 1; if (null == charList) for (int i = end; i >= 0; i--) if (Character.isWhitespace(str.charAt(i))) end--; else break; else ... |
String | rtrim(String str, String defaultValue) This function returns a string with whitespace stripped from the end of str if (str == null) return defaultValue; int len = str.length(); while ((0 < len) && (str.charAt(len - 1) <= ' ')) { len--; return (len < str.length()) ? str.substring(0, len) : str; |
String | rtrim(String str, String suffixs) rtrim if (isNull(str) || isNull(suffixs)) return str; int i = str.length() - 1; for (; i >= 0; i--) { if (suffixs.indexOf(str.charAt(i)) == -1) break; return str.substring(0, i + 1); ... |
String | rtrim(String string, String end) rtrim if (string.endsWith(end)) { string = string.substring(0, string.length() - end.length()); return string; |
String | rtrim(String text, char c) rtrim if (text == null) { return EMPTY; int i = 0; int j = text.length(); while ((i < j) && (text.charAt(j - 1) == c)) { j--; return (j < text.length()) ? text.substring(i, j) : text; |
String | rTrim(String value) r Trim if (value == null) { return null; int index = value.length(); while (index > 0 && isWhitespace(value.charAt(index - 1))) { index--; return value.substring(0, index); ... |
String | rtrim(String value, int maxLength) rtrim String result = nvl(value).trim(); if (result.length() > maxLength) { result = result.substring(0, maxLength); return result; |
String | rTrimObj(Object o) r Trim Obj return rTrim(nz(o));
|