Java examples for Language Basics:String
Match String with upper or lower case
public class Main { public static void main(String[] args) throws Exception { String str = "true"; // This will test against both upper & lower case "T"...this will be TRUE boolean result = str.matches("[Tt]rue"); System.out.println(result);//from w w w .jav a2 s. com } }