Java Boolean From toBoolean(final String s)

Here you can find the source of toBoolean(final String s)

Description

to Boolean

License

Apache License

Declaration

public static boolean toBoolean(final String s) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean toBoolean(final String s) {
        return "true".equalsIgnoreCase(s) || "1".equalsIgnoreCase(s) || "on".equalsIgnoreCase(s)
                || "enable".equalsIgnoreCase(s) || "yes".equalsIgnoreCase(s);
    }//from  w w  w  .  j  av  a2 s .com
}

Related

  1. toBoolean(final Object value)
  2. toBoolean(final Object value, final boolean defaultValue)
  3. toBoolean(final Object valueRep)
  4. toBoolean(final String booleanString, final boolean defaultValue)
  5. toBoolean(final String s)
  6. toBoolean(final String source)
  7. toBoolean(final String string)
  8. toBoolean(final String strTransparent)
  9. toBoolean(final String val)