Here you can find the source of toBool(String str)
Parameter | Description |
---|---|
envVal | a non-empty string |
private static boolean toBool(String str)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w. ja va2s. c o m*/ * Returns a boolean representation of the provided string * @param envVal a non-empty string */ private static boolean toBool(String str) { switch (str.charAt(0)) { case 't': case 'T': case '1': return true; default: return false; } } }