C# Programming - Strings - Discussion
Discussion Forum : Strings - General Questions (Q.No. 14)
14.
If s1 and s2 are references to two strings then which of the following are the correct ways to find whether the contents of the two strings are equal?
if(s1 = s2)
if(s1 == s2)
int c; c = s1.CompareTo(s2);
if( strcmp(s1, s2) )
if (s1 is s2)
Discussion:
1 comments Page 1 of 1.
Harshit Gupta said:
8 years ago
But == operator is for reference equality. It is not there for content equality. So how?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers