Check Equality for two strings with Collator
import java.text.Collator;
import java.util.Locale;
public class Main {
public static void main(String args[]) {
String s1 = "";
String s2 = "";
Collator frCollator = Collator.getInstance(Locale.FRANCE);
frCollator.setStrength(Collator.SECONDARY);
if (frCollator.compare(s1, s2) == 0) {
System.out.println("s1 = s2");
}
}
}
//s1 = s2
Related examples in the same category