C# String Compare()The C# Compare() method is used to compare first string with second string lexicographically. It returns an integer value. If both strings are equal, it returns 0. If first string is greater than second string, it returns 1 else it returns -1. RuleSignaturesParametersfirst: first argument represents string which is to be compared with second string. second: second argument represents string which is to be compared with first string. ReturnIt returns an integer value. C# String Compare() Method ExampleOutput: 0 1 -1
Next TopicC# String CompareOrdinal()
|