List of utility methods to do String Trim Left
String | ltrim(String s) Remove all leading blanks. int index = 0; while (index < s.length() && isSpace(s.charAt(index))) index++; return s.substring(index, s.length()); |
String | ltrim(String s) ltrim int i = 0; while (i < s.length() && Character.isWhitespace(s.charAt(i))) i++; return s.substring(i); |
String | ltrim(String s) Does left trim. if (s == null) return null; int len = s.length(); int st = 0; while ((st < len) && (s.charAt(st) <= ' ')) { st++; return ((st > 0) ? s.substring(st) : s); ... |
String | ltrim(String s) Left trims a string. if (s == null) return null; for (int k = 0; k < s.length(); k++) { if (!Character.isWhitespace(s.charAt(k))) return (k == 0 ? s : s.substring(k)); return ""; |
String | ltrim(String s, char character) ltrim int i = 0; while (i < s.length() && s.charAt(i) == character) { i++; return i(s, i); |
String | ltrim(String s, Character c) ltrim if (s == null) { return null; if (c == null) { return s; int len = s.length(); int st = 0; ... |
String | ltrim(String source) ltrim return source.replaceAll("^\\s+", ""); |
String | ltrim(String source) remove leading whitespace return source.replaceAll("^\\s+", ""); |
String | ltrim(String source) Left trim: remove spaces to the left of a String. if (source == null) return null; int from = 0; while (from < source.length() && isSpace(source.charAt(from))) from++; return source.substring(from); |
String | ltrim(String src, char ch, int nLen) ltrim if (src == null || src.length() <= nLen) return src; char[] czSrc = src.toCharArray(); int i, j; int n = czSrc.length; for (i = 0; (n - i) > nLen; i++) { if (czSrc[i] != ch) break; ... |