I have six string variables say str11, str12, str13, str21, str21 and str23.
I need to compare combination of these variables.
The combinations I have to check is str11 — str12 — str13 as one group and str21 — str22 — str23 as other group. I have to compare these two groups.
Now I’m in confusion which method should I use for comparison?
Can I append strings of same group and compare, which is only one comparison say ( str11 append str12 append str13 ) eqauls ( str21 append str22 append str23 )
Or
Should I go for individual 3 comparisons?
if( str11 equals str21 ) { if( str12 equals str22 ) { if( str13 equals str23 ) { } } }
What is performance factor which costs me because of string length when I do string comparison? Lets us assume all strings are of same( approx ) length.
I’d test individually.
Is “AB” “CD” “EF” equal to “ABC” “DE” “F”?
Me thinks not.
P.S. If it is, then it’s a VERY special case, and if you decide to code it that way (as a concatenated comparison) then comment the hell out of it.