How to check if string contains case-insensitive substring in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string s = "C# Programming Language";

        Console.Write(s.IndexOf("LANGUAGE", StringComparison.OrdinalIgnoreCase) >= 0);
    }
}



/*
run:

True

*/

 



answered May 29, 2021 by avibootz

Related questions

...