/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.text.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
System.
out.
println(contanisIgnoreAccents
("Este é joao",
"João")); System.
out.
println(contanisIgnoreAccents
("Onde está joÂo",
"João")); }
public static boolean contanisIgnoreAccents
(String a,
String b
) { String input1
= Normalizer.
normalize(a, Normalizer.
Form.
NFD) .replaceAll("\\p{InCombiningDiacriticalMarks}+", "")
.toLowerCase();
String input2
= Normalizer.
normalize(b, Normalizer.
Form.
NFD) .replaceAll("\\p{InCombiningDiacriticalMarks}+", "")
.toLowerCase();
return input1.contains(input2);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnRleHQuKjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU3lzdGVtLm91dC5wcmludGxuKGNvbnRhbmlzSWdub3JlQWNjZW50cygiRXN0ZSDDqSBqb2FvIiwgIkpvw6NvIikpOwoJCVN5c3RlbS5vdXQucHJpbnRsbihjb250YW5pc0lnbm9yZUFjY2VudHMoIk9uZGUgZXN0w6Egam/Dgm8iLCAiSm/Do28iKSk7Cgl9CgkKCXB1YmxpYyBzdGF0aWMgYm9vbGVhbiBjb250YW5pc0lnbm9yZUFjY2VudHMoU3RyaW5nIGEsIFN0cmluZyBiKSB7CgkJU3RyaW5nIGlucHV0MSA9IE5vcm1hbGl6ZXIubm9ybWFsaX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