fork download
  1. using static System.Console;
  2. using System;
  3.  
  4. public class Program {
  5. public static void Main() {
  6. var mainStr = "Joaquim Pedro Soares";
  7. WriteLine(mainStr.Contains("JOA", StringComparison.OrdinalIgnoreCase));
  8. WriteLine(mainStr.Contains("Quim", StringComparison.OrdinalIgnoreCase));
  9. WriteLine(mainStr.Contains("PEDRO", StringComparison.OrdinalIgnoreCase));
  10. WriteLine(mainStr.Contains("PeDro", StringComparison.OrdinalIgnoreCase));
  11. }
  12. }
  13.  
  14. namespace System {
  15. public static class StringExt {
  16. public static bool Contains(this string source, string search, StringComparison comparison) => source.IndexOf(search, comparison) >= 0;
  17. }
  18. }
  19.  
  20. //https://pt.stackoverflow.com/q/179568/101
Success #stdin #stdout 0.02s 15912KB
stdin
Standard input is empty
stdout
True
True
True
True