Android String to Boolean Convert isTextBoolean(String texto)

Here you can find the source of isTextBoolean(String texto)

Description

is Text Boolean

License

Open Source License

Declaration

public static boolean isTextBoolean(String texto) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static boolean isTextBoolean(String texto) {
        boolean out = false;
        if (texto != null) {
            texto = texto.toLowerCase().trim();
            if ("true".equals(texto) || "false".equals(texto)) {
                return true;
            }//  w ww. j a v a  2s .c  om
        }
        return out;
    }
}

Related

  1. toBool(String str)
  2. toBoolean(final String value)
  3. getBool(String str, boolean b)
  4. toBool(String b)
  5. getBooleanValue(String string)
  6. parseBoolean(String string)