Here you can find the source of booleanValueWithYN(String string)
Parameter | Description |
---|---|
string | String The string to be judged |
public static boolean booleanValueWithYN(String string)
//package com.java2s; public class Main { /**//from w ww. j a v a2 s. c om * This method is to convert a boolean value with a y or n string. * * @param string String The string to be judged * @return boolean */ public static boolean booleanValueWithYN(String string) { if (string == null) { return false; } return string.equalsIgnoreCase("YES") || string.equalsIgnoreCase("y"); } }