How can you compare strings using the Compare() method?

What will be an ideal response?


The Compare() method requires two string arguments and returns an integer result. When it returns 0, the two strings are equivalent; when it returns a positive number, the first string is greater than the second; and when it returns a negative number, the first string is less than the second. A string is considered equal to, greater than, or less than another string lexically, which in the case of letter values means alphabetically. That is, when you compare two strings, you compare each character in turn from left to right. If each Unicode value is the same, then the strings are equivalent. If any corresponding character values are different, the string that has the greater Unicode value earlier in the string is considered greater.

Computer Science & Information Technology

You might also like to view...

Which loop computes the sum of 1/2 + 2/3 + 3/4 + 4/5 + … + 99/100?

(A) For n As Integer = 1 To 99 s += n / (1 + n) Next (B) For q As Integer = 100 To 1 s += (q + 1) /q Next (C) For d As Integer = 2 To 99 s = 1 / d + d / (d + 1) Next (D) For x As Integer = 1 To 100 s += 1 / (x + 1) Next

Computer Science & Information Technology

A document that uses text, pictures, and drawings to convey its message is called a(n) ____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

An advantage to using the cloud to store your files from your mobile device is: __________.

a. files can easily be shared with others b. you can access your files more quickly c. your files are more secure in the cloud

Computer Science & Information Technology

The Formula Auditing group on the Formulas tab on the Ribbon also can be helpful when verifying ____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology