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(String str)
returns the length of the given string.
return str == null ? 0 : str.length();
intlength(String str)
Gets a String's length or 0 if the String is null.
return str == null ? 0 : str.length();
intlength(String string)
Returns the length or number of characters of the string.
int length = 0;
if (string != null)
    length = string.length();
return length;
intlength(String string)
length
return string == null ? 0 : string.length();
intlength(String... args)
Cumulative length of strings in varargs
if (args == null)
    return 0;
int acc = 0;
for (String arg : args) {
    acc += arg.length();
return acc;
booleanlengthBetween(String param, int minLength, int maxLength)
length Between
boolean flag = false;
if (notNOE(param)) {
    if (param.length() >= minLength && param.length() <= maxLength) {
        flag = true;
return flag;
intlengthByteInPrepared(String s)
length Byte In Prepared
int length = 0;
if (s == null) {
    return length;
for (int i = 0; i < s.length(); i++) {
    if (s.charAt(i) <= 127) {
        length++;
    } else {
...
booleanlengthCheck(final String str, final int minLength, final int maxLength)
Check the length of the string str using the minimum and maximum values provided.
int len = str.length();
return len >= minLength && len <= maxLength;
StringlengthConstToString(int val, int len)
length Const To String
StringBuffer sbuf = new StringBuffer();
int factor = 1;
for (int i = 0; i < len; i++)
    factor *= 10;
for (boolean done = false; !done;) {
    if (val / factor == 0) {
        sbuf.append('0');
        factor /= 10;
...
floatLengthConversionFactor(String OldUnits)
Length Conversion Factor
int n = getNumericStart(OldUnits);
float factor = 1;
if (n > 0)
    try {
        factor = (new Float(OldUnits.substring(0, n))).floatValue();
    } catch (Exception ss) {
        factor = 1;
OldUnits = OldUnits.substring(n);
if ("m;meter;met;".indexOf(OldUnits + ";") >= 0)
    return factor * 1;
if ("cm;centim;centimeter;cmeter;cmet;100mm;100millim;100millimeter;".indexOf(OldUnits + ";") >= 0)
    return factor * .01f;
if ("mm;millim;millimeter;100um;100microm;".indexOf(OldUnits + ";") >= 0)
    return factor * .001f;
if ("um;umet;umeter;umeters;".indexOf(OldUnits) >= 0)
    return factor * .000001f;
if ("in;inch;".indexOf(OldUnits + ";") >= 0)
    return factor * (float) (1.0 / 254.0);
if ("ft;foot;feet;".indexOf(OldUnits + ";") >= 0)
    return factor * (float) (12.0 / 254.0);
return factor * 1.0f;