Here you can find the source of toBool(String str)
public static boolean toBool(String str)
//package com.java2s; /** Copyright ? 2015 Holger Steffan H.St. Soft * // www . j a v a 2s. co m * This file is subject to the terms and conditions defined in file 'license', which is part of this source code * package. */ public class Main { public static boolean toBool(String str) { if (!str.toLowerCase().equals("false") && !str.toLowerCase().equals("true")) throw new NumberFormatException("Can't convert '" + str + "' to bool"); return Boolean.parseBoolean(str); } }