Select from following answers:- Dim n As Integer = String.Compare(string1, string2)

- Dim n As Integer = String.Compare(string1, string2,True)
- string1.Equals(string2)
- string1=string2
- All Above
Above all methods are used to Compare string values.
In String.Compare method -
Dim n As Integer = String.Compare(string1, string2)-> If both strings are same and in upper/lower case. If it returns 0 then both strings are EQUAL.
Dim n As Integer = String.Compare(string1, string2,True) -> In this case, if 1 string is in lower case and other is in upper case, and ignore case will be True, it also returns 0.
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator