Java Boolean From toBoolean(String content)

Here you can find the source of toBoolean(String content)

Description

to Boolean

License

Open Source License

Declaration

public static boolean toBoolean(String content) 

Method Source Code

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

public class Main {
    public static boolean toBoolean(String content) {
        switch (content.toLowerCase().trim()) {
        case "on":
        case "true":
        case "yes":
            return true;
        case "off":
        case "false":
        case "no":
            return false;
        }/*from  w ww . ja va2s . c om*/
        return false;
    }
}

Related

  1. toBoolean(Object value)
  2. toBoolean(Object value)
  3. toBoolean(Object value, Boolean defaultValue)
  4. toBoolean(Object value, boolean defaultValue)
  5. toBoolean(String baseString)
  6. toBoolean(String flag)
  7. toBoolean(String input, boolean defaultValue)
  8. toBoolean(String inString)
  9. toBoolean(String propertyValue)