List of utility methods to do String Length Get
int | length(final String s) Use this method when you don't want a length check to throw a NullPointerException when return s == null ? 0 : s.length();
|
int | length(final String s, final String separator) length final String[] list = s.split(separator); return list.length; |
int | length(Object string) length if (string instanceof String) return ((String) string).length(); if (string instanceof StringBuffer) return ((StringBuffer) string).length(); throw new IllegalArgumentException("expecting String or StringBuffer"); |
double | length(String arg) length return arg != null ? arg.length() : 0;
|
int | length(String buffer) length if (buffer == null || buffer.equals("")) { return 0; return buffer.getBytes().length; |
int | length(String s) length int len = 0; for (char c : s.toCharArray()) { if (c >= 0x80) { len += 2; } else { len++; return len; |
int | length(String s) Get the length of a string, null input is considered 0 length. return s == null ? 0 : s.length();
|
int | length(String schema) length return isEmpty(schema) ? 0 : schema.length();
|
int | length(String source) length int result = 0; if (isNotEmpty(source)) { result = source.length(); return result; |
int | length(String str) length if (str == null) return 0; char[] c = str.toCharArray(); int len = 0; for (int i = 0; i < c.length; i++) { len++; if (!isLetter(c[i])) { len++; ... |