Java Utililty Methods String Length Get

List of utility methods to do String Length Get

Description

The list of methods to do String Length Get are organized into topic(s).

Method

intlength(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();
intlength(final String s, final String separator)
length
final String[] list = s.split(separator);
return list.length;
intlength(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");
doublelength(String arg)
length
return arg != null ? arg.length() : 0;
intlength(String buffer)
length
if (buffer == null || buffer.equals("")) {
    return 0;
return buffer.getBytes().length;
intlength(String s)
length
int len = 0;
for (char c : s.toCharArray()) {
    if (c >= 0x80) {
        len += 2;
    } else {
        len++;
return len;
intlength(String s)
Get the length of a string, null input is considered 0 length.
return s == null ? 0 : s.length();
intlength(String schema)
length
return isEmpty(schema) ? 0 : schema.length();
intlength(String source)
length
int result = 0;
if (isNotEmpty(source)) {
    result = source.length();
return result;
intlength(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++;
...