Java Boolean From toBoolean(String str)

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

Description

Converts a string to a boolean

License

Open Source License

Parameter

Parameter Description
str String to convert

Return

The boolean represented by the argument

Declaration

public static boolean toBoolean(String str) 

Method Source Code

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

public class Main {
    /**//w  w w . j  av a 2 s . c om
     * Converts a string to a {@code boolean}
     * 
     * @param str String to convert
     * @return The {@code boolean} represented by the argument
     */
    public static boolean toBoolean(String str) {
        return str != null && str.equalsIgnoreCase("true");
    }
}

Related

  1. toBoolean(String input, boolean defaultValue)
  2. toBoolean(String inString)
  3. toBoolean(String propertyValue)
  4. toBoolean(String s)
  5. toBoolean(String s)
  6. toBoolean(String str)
  7. toBoolean(String str)
  8. toBoolean(String str)
  9. toBoolean(String string)