Answers for "C# Check if variables are equal"

C#
0

C# Check if variables are equal

string str1 = "1";
string str2 = "1";

if(String.Compare(str1, str2) == 0)
{
    Console.WriteLine(str1 + " and " + str2 + " are equal");
}
else
{
    Console.WriteLine(str1 + " and " + str2 + " are not equal");
}
Console.ReadKey();
Posted by: Guest on September-30-2021

Code answers related to "C# Check if variables are equal"

C# Answers by Framework

Browse Popular Code Answers by Language