List of utility methods to do String Trim Left
String | leftTrim(String string) left Trim if (string == null) { return ""; return string.replaceFirst("^\\s+", ""); |
String | leftTrim(String value) left Trim int count = 0; while (Character.isWhitespace(value.charAt(count))) { count++; return value.substring(count); |
StringBuilder | leftTrim(StringBuilder pStringBuilder) Similar to the Perl chomp command. while (true) { if (pStringBuilder.length() != 0 && Character.isWhitespace(pStringBuilder.charAt(0))) { pStringBuilder.deleteCharAt(0); } else { break; return pStringBuilder; ... |
String | leftTrimSlashes(String s) Returns the specified string with all leading slashes removed. while (s.startsWith("/")) { s = s.substring(1); return s; |
byte[] | ltrim(byte[] a) ltrim if (a == null || a.length == 0) { return a; int index = 0; while (index < a.length && a[index] == 0) { index++; if (index == 0) { ... |
CharSequence | ltrim(CharSequence str) Trim horizontal whitespace from left side. int len; int i; if (str == null || (len = str.length()) <= 0) return ""; for (i = 0; i < len; i++) if (!Character.isWhitespace(str.charAt(i))) break; if (i >= len) ... |
String | ltrim(final String str) ltrim int i; int j; int x = 0; for (i = 0; i < str.length(); i++) { char ch = str.charAt(i); if (ch != ' ') { break; final int len = (str.length() - i); char[] res = new char[len]; for (j = i; j < str.length(); j++) { res[x++] = str.charAt(j); return new String(res, 0, len); |
String | ltrim(final String str, final char filler) Performs left trim if (str == null) return null; for (int i = 0; i < str.length(); ++i) { if (str.charAt(i) != filler) { return str.substring(i); return ""; ... |
String | ltrim(final String text) ltrim return ltrim(text, null);
|
String | lTrim(final String value) Removes empty space from the beginning of a string if (value == null) { return null; String trimmed = value; int offset = 0; final int maxLength = value.length(); while (offset < maxLength && (value.charAt(offset) == ' ' || value.charAt(offset) == '\t')) { offset++; ... |