Converting a String array to list and be able to do a case insensitive search.
String[] str = {"ONE", "TWO", "THREE", "two"};
Set set = new TreeSet(String.CASE_INSENSITIVE_ORDER);
set.addAll(Arrays.asList(str));
System.out.println(set.contains("one"));
String[] str = {"ONE", "TWO", "THREE", "two"};
Set set = new TreeSet(String.CASE_INSENSITIVE_ORDER);
set.addAll(Arrays.asList(str));
System.out.println(set.contains("one"));
0 comments:
Post a Comment