How to compare two string for data equality ( assuming two strings are given with the names S and SS ) ?
Options 1, 2 & 3 are correct way to compare two strings for data equality.
Options 2,3 & 5 Only correct.
Options 2,4&5 Only Only correct.
All the 5 options can be used for checking 2 strings data equality.
Though all the 5 options gives approximately same result but it is standard practice to use == ( double equals to ) for checking data equality of 2 strings. It also recommended to convert both the strings either into upper case or lower case and then go for the comparison.
Back To Top