Hi,
Sometimes you may need to check whether two strings are equal or not equal by checking case insensitive. See the example below to see how to achieve the same using C Sharp /C#.
using System; class MainClass { public static void Main() { string strOne = "heaven"; string strTwo = "HEAVEN"; if(String.Compare(strOne , strTwo , true) == 0) Console.WriteLine(strOne + " and " + strTwo + " are equal - Case Insensitive!"); else Console.WriteLine(strOne + " and " + strTwo + " are not equal - Case Insensitive!"); } }
Output : heaven and HEAVEN are equal – Case Insensitive!
🙂