List of utility methods to do String Trim Left
String | leftAndRightTrim(String input, char charToTrim) Removes the occurrences of the passed char in the start and end of the string. return rightTrim(leftTrim(input, charToTrim), charToTrim);
|
int | leftTrim(char[] text, int offset) Return number of whitespace character from the offset to the first non whitespace character. int counter = 0; if (text != null && offset < text.length) { while (Character.isWhitespace(text[offset + counter])) { counter++; return counter; |
String | leftTrim(final String aString) Copies this String removing white space characters from the beginning of the string. if (aString == null) { return null; int start = 0; while ((start < aString.length()) && (aString.charAt(start) <= ' ')) { start++; if (start == 0) { ... |
String | leftTrim(final String input) Get a version of a String with all leading whitespace removed. if (input == null) { return null; final int len = input.length(); int beginIndex = 0; for (int i = 0; i < len; i++) { if (Character.isWhitespace(input.charAt(i))) { ++beginIndex; ... |
String | leftTrim(final String input, final char charToTrim) Removes the occurrences of the passed char in the end of the string. final int len = input.length(); int off = 0; final char[] val = input.toCharArray(); while (off < len && val[off] == charToTrim) { off++; return input.substring(off, len); |
String | leftTrim(String input, char charToTrim) Removes the occurrences of the passed char in the end of the string. int len = input.length(); int off = 0; char[] val = input.toCharArray(); while ((off < len) && (val[off] == charToTrim)) { off++; return input.substring(off, len); |
String | leftTrim(String rawString) left Trim int firstNonSpace = 0; for (int i = 0; i < rawString.length(); i++) { final char ch = rawString.charAt(i); if (ch > 32) { break; firstNonSpace++; return rawString.substring(firstNonSpace); |
String | leftTrim(String str) left Trim if (isEmpty(str)) return str; char[] charArray = str.toCharArray(); int length = charArray.length; int start = 0; while ((start < length) && (charArray[start] <= ' ')) start++; return str.substring(start); ... |
String | lefttrim(String str) Removes all spaces from a string String newString = str; for (int i = 0; i < newString.length(); i++) { if (newString.charAt(i) != ' ') { newString = newString.substring(i); break; return newString; ... |
String | leftTrim(String str) Removes leading whitespaces. if (str.length() == 0) { return str; int i = 0; while (i < str.length()) { char c = str.charAt(i); if (Character.isWhitespace(c)) { i++; ... |