Java Set equality ignore case

Alternatively you can use TreeSet. public static void main(String[] args){ Set<String> s1 = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); s1.addAll(Arrays.asList(new String[] {“a”, “b”, “c”})); Set<String> s2 = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); s2.addAll(Arrays.asList(new String[] {“A”, “B”, “C”})); System.out.println(s1.equals(s2)); }

How to ignore case in String.replace

Use a regular expression: var regex = new Regex( “camel”, RegexOptions.IgnoreCase ); var newSentence = regex.Replace( sentence, “horse” ); Of course, this will also match words containing camel, but it’s not clear if you want that or not. If you need exact matches you can use a custom MatchEvaluator. public static class Evaluators { public … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)