Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c sharp if string equals

// There are two ways to check if 2 strings are the same:
string str1 = "Hello";
string str2 = "Hello";

// The first is using double equals sign ==
str1 == str2; // Output: true

// The second is using the 'Equals()' function
str1.Equals(str2); // Output: true
Comment

PREVIOUS NEXT
Code Example
Csharp :: includes method C# 
Csharp :: c# keep console open 
Csharp :: conditional blazor styles 
Csharp :: readonly vs const c# 
Csharp :: list string to int c# 
Csharp :: basic movement script unity 
Csharp :: c# switch by type of object 
Csharp :: unity click on 2d object 
Csharp :: unity detect any key 
Csharp :: c# convert object to string 
Csharp :: tests not showing in test explorer 
Csharp :: ggdesign 
Csharp :: perlin noise unity 
Csharp :: unity controls 3d 
Csharp :: unity how to get the first word from string 
Csharp :: c# list sort by property string 
Csharp :: c# append textbox 
Csharp :: get execution directory c# 
Csharp :: displayname c# 
Csharp :: c# parse the date in DD/MMM/YYYY format 
Csharp :: c# shuffle list 
Csharp :: c# compile code at runtime 
Csharp :: Razor foreach loop 
Csharp :: c# void 
Csharp :: mvc 5 dropdownlist 
Csharp :: clear controls from panel c# 
Csharp :: convert.tostring with datetime string 
Csharp :: c# unity detect any keyboard input 
Csharp :: how to write int array to console c# 
Csharp :: c# merging two arrays 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =