1.

What is the value returned by the function CompareTo() if the invoking string is less than the string compared?(a) zero(b) value less than zero(c) value greater than zero(d) none of the mentionedI got this question in a job interview.My question comes from String Formatting in division Miscellaneous topics of C#

Answer»

Correct choice is (B) value less than zero

The best I can EXPLAIN: CompareTo() function returns zero when both the strings are equal, it returns a value less than zero if the invoking STRING is less than the other string being compared and value greater than zero when invoking string is greater than the string compared to.



Discussion

No Comment Found

Related InterviewSolutions