Java tutorial
//package com.java2s; public class Main { /** * * @param bool * @return */ public static boolean convertStringToBoolean(String bool) { bool = bool.toLowerCase().toString().trim(); if (bool.equalsIgnoreCase("t") || bool.equalsIgnoreCase("true") || bool.equalsIgnoreCase("1") || bool.equalsIgnoreCase("yes") || bool.equalsIgnoreCase("y") || bool.equalsIgnoreCase("ok")) { return true; } return false; } }