List of utility methods to do String Trim Right
String | rightTrim(final String aString) Copies this String removing white space characters from the end of the string. if (aString == null) { return null; int end = aString.length() - 1; while ((end >= 0) && (aString.charAt(end) <= ' ')) { end--; if (end == aString.length() - 1) { ... |
String | rightTrim(final String input, final char charToTrim) Removes the occurrences of the passed char in the beggining of the string. int len = input.length(); final int st = 0; final int off = 0; final char[] val = input.toCharArray(); while (st < len && val[off + len - 1] == charToTrim) { len--; return input.substring(0, len); ... |
String | rightTrim(String input, char charToTrim) Removes the occurrences of the passed char in the beggining of the string. int len = input.length(); int st = 0; int off = 0; char[] val = input.toCharArray(); while ((st < len) && (val[off + len - 1] == charToTrim)) { len--; return input.substring(0, len); ... |
String | rightTrim(String s) right Trim int pos = s.length(); while (--pos >= 0) if (!Character.isWhitespace(s.charAt(pos))) break; return s.substring(0, pos + 1); |
String | rightTrim(String s, char c) right Trim int stop; for (stop = s.length(); stop > 0; stop--) { if (s.charAt(stop - 1) != c) { break; if (stop > 0) { return s.substring(0, stop); ... |
String | rightTrim(String src) right Trim if (src != null) { char[] chars = src.toCharArray(); for (int i = chars.length - 1; i >= 0; i--) { if ((chars[i] != ' ') && (chars[i] != '\t') && (chars[i] != '\r')) { return src.substring(0, i + 1); return ""; ... |
String | rightTrim(String str) right Trim if (str == null) return str; int len = str.length(); int count = 0; for (int i = len - 1; i >= 0; i--) { if (str.charAt(i) == ' ' || str.charAt(i) == '\n' || str.charAt(i) == '\r' || str.charAt(i) == '\t') { count++; } else { ... |
String | rightTrim(String str) right Trim if (isEmpty(str)) return str; char[] charArray = str.toCharArray(); int length = charArray.length; int start = 0; while ((start < length) && (charArray[length - 1] <= ' ')) length--; return str.substring(0, length); ... |
String | rightTrim(String str) Removes trailing whitespaces. if (str.length() == 0) { return str; int i = str.length() - 1; while (i >= 0) { char c = str.charAt(i); if (Character.isWhitespace(c)) { i--; ... |
String | rightTrim(String string) right Trim if (string == null) { return ""; return string.replaceFirst("\\s+$", ""); |