Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
80 views
Welcome To Ask or Share your Answers For Others

1 Answer

Ripped from msdn

string.Equals

Determines whether this instance and a specified object, which must also be a String object, have the same value.

string.Compare Compares two specified String objects and returns an integer that indicates their relative position in the sort order.

string.CompareTo Compares this instance with a specified object or String and returns an integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified object or String.

string.CompareOrdinal Compares two specified String objects by evaluating the numeric values of the corresponding Char objects in each string.

String equality operators The predefined string equality operators are:

bool operator ==(string x, string y); bool operator !=(string x, string y); Two string values are considered equal when one of the following is true:

Both values are null. Both values are non-null references to string instances that have identical lengths and identical characters in each character position. The string equality operators compare string values rather than string references. When two separate string instances contain the exact same sequence of characters, the values of the strings are equal, but the references are different. As described in Section 7.9.6, the reference type equality operators can be used to compare string references instead of string values.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...