Ignore the case while comparing two strings in C#

Below is the best way to compare the string in C# and ignore the case sensitive.

string strCompare = "testcomPARE";
if (strCompare.Equals("testcompare", StringComparison.InvariantCultureIgnoreCase))
{
    ///
}
Ebook Download
View all
Learn
View all