Hello,

I have four strings, string1, string2, string3 and string4. Two of these strings are equal, now I want to find out which are equal and put the result into two strings, e.g. result1="3" result2="4" if string 3 and 4 are equal. Of course I can do an if then else ladder

Code:
if(string1.equalsIgnoreCase(string2))
    		{
    			result1="1";
                                                result2="2";
    		}
else if(string1.equalsIgnoreCase(string3))
    		{
    			result1="1";
                                                result2="3";

    		}
//and so on
Is there a better way of doing this? result1 can be given as a string as above or as well as an integer if that makes it easier.

Having 4 strings the above code can handle it, but what if I have a 100 strings.

Thanks,
J.