using static System.Console;
using System;
public class Program {
public static void Main() {
var mainStr = "Joaquim Pedro Soares";
WriteLine(mainStr.Contains("JOA", StringComparison.OrdinalIgnoreCase));
WriteLine(mainStr.Contains("Quim", StringComparison.OrdinalIgnoreCase));
WriteLine(mainStr.Contains("PEDRO", StringComparison.OrdinalIgnoreCase));
WriteLine(mainStr.Contains("PeDro", StringComparison.OrdinalIgnoreCase));
}
}
namespace System {
public static class StringExt {
public static bool Contains(this string source, string search, StringComparison comparison) => source.IndexOf(search, comparison) >= 0;
}
}
//https://pt.stackoverflow.com/q/179568/101
dXNpbmcgc3RhdGljIFN5c3RlbS5Db25zb2xlOwp1c2luZyBTeXN0ZW07CgkJCQkJCnB1YmxpYyBjbGFzcyBQcm9ncmFtIHsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkgewoJCXZhciBtYWluU3RyID0gIkpvYXF1aW0gUGVkcm8gU29hcmVzIjsKCQlXcml0ZUxpbmUobWFpblN0ci5Db250YWlucygiSk9BIiwgU3RyaW5nQ29tcGFyaXNvbi5PcmRpbmFsSWdub3JlQ2FzZSkpOwoJCVdyaXRlTGluZShtYWluU3RyLkNvbnRhaW5zKCJRdWltIiwgU3RyaW5nQ29tcGFyaXNvbi5PcmRpbmFsSWdub3JlQ2FzZSkpOwoJCVdyaXRlTGluZShtYWluU3RyLkNvbnRhaW5zKCJQRURSTyIsIFN0cmluZ0NvbXBhcmlzb24uT3JkaW5hbElnbm9yZUNhc2UpKTsKCQlXcml0ZUxpbmUobWFpblN0ci5Db250YWlucygiUGVEcm8iLCBTdHJpbmdDb21wYXJpc29uLk9yZGluYWxJZ25vcmVDYXNlKSk7Cgl9Cn0KCm5hbWVzcGFjZSBTeXN0ZW0gewoJcHVibGljIHN0YXRpYyBjbGFzcyBTdHJpbmdFeHQgewoJCXB1YmxpYyBzdGF0aWMgYm9vbCBDb250YWlucyh0aGlzIHN0cmluZyBzb3VyY2UsIHN0cmluZyBzZWFyY2gsIFN0cmluZ0NvbXBhcmlzb24gY29tcGFyaXNvbikgPT4gc291cmNlLkluZGV4T2Yoc2VhcmNoLCBjb21wYXJpc29uKSA+PSAwOwoJfQp9CgovL2h0dHBzOi8vcHQuc3RhY2tvdmVyZmxvdy5jb20vcS8xNzk1NjgvMTAx