Here you can find the source of toBoolean(String str)
Parameter | Description |
---|---|
str | String to convert |
public static boolean toBoolean(String str)
//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"); } }