Answers for "c# how to compare strings"

C#
3

compare text c#

string str1 = "London";
string str2 = "London";
 
str1 == str2; // true
str1.Equals(str2); // true
Posted by: Guest on December-14-2020
0

c# string.compare

public static int Compare (string? strA, string? strB);
                                                                                 
//Less than zero strA precedes strB in the sort order
//zero strA occurs in the same position as strB in the sort order
//Greater than zero strA follows strB in the sort order
Posted by: Guest on June-02-2021
-1

how to compare two strings in c# using if condition

string name1 = "content";
string name2 = "content";

if (string.compare(name1,name2) == 0)
{
	"ACTION"
}
Posted by: Guest on August-09-2021

C# Answers by Framework

Browse Popular Code Answers by Language