Java Utililty Methods String to Boolean

List of utility methods to do String to Boolean

Description

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

Method

booleanatob(String s)
atob
return (s != null && (s.equals("1") || s.equalsIgnoreCase("true") || s.equalsIgnoreCase("yes")));
booleanconvertStringToBoolean(String pValue)
convert String To Boolean
boolean returnValue = false;
if ("T".equals(pValue)) {
    returnValue = true;
return returnValue;
booleanconvertStringToBoolean(String strBoolean)
Convert string to boolean.
boolean theValue = Boolean.parseBoolean(strBoolean);
return theValue;
booleanconvertStringToBoolean(String string)
convert String To Boolean
if (string.equals("true")) {
    return true;
} else {
    return false;
BooleanconvertStringToBoolean(String string)
Convert a string into an appropriate boolean value, true or false.
Boolean bValue = null;
if (string != null) {
    if ("1".equals(string) || "T".equalsIgnoreCase(string) || "Y".equalsIgnoreCase(string)
            || "true".equalsIgnoreCase(string) || "yes".equalsIgnoreCase(string)) {
        bValue = Boolean.TRUE;
    } else {
        bValue = Boolean.FALSE;
return bValue;
booleanstringToBoolean(String expr)
Converts a string to a boolean value, accepting "true", "t", "1", "yes" and "y" as true, accepting "false", "f", "0", "no", "n" as false, and throwing an IllegalArgumentException when none of these strings match.
String cleanExpr = expr.toLowerCase().trim();
if (cleanExpr.equals("true") || cleanExpr.equals("t") || cleanExpr.equals("1") || cleanExpr.equals("yes")
        || cleanExpr.equals("y")) {
    return true;
} else if (cleanExpr.equals("false") || cleanExpr.equals("f") || cleanExpr.equals("0")
        || cleanExpr.equals("no") || cleanExpr.equals("n")) {
    return false;
} else {
...
boolean[]stringToBooleanArray(String string, String delim)
string To Boolean Array
StringTokenizer tokens = new StringTokenizer(string, delim);
boolean[] ret = new boolean[tokens.countTokens()];
for (int i = 0; i < ret.length; i++) {
    ret[i] = tokens.nextToken().equals("T");
return ret;