I'll probably have my info push into an array. but I do not want to check each sequence one by one as it's gonna take a long process. is there a better way to solve this? Thanks
It is not clear what you will have pushed into an array, but you can use the indexOf() method of the Array or the String class to check if they contain certain characters/elements.
if(String("ABC").indexOf("C") > -1) // C is in the string
if(String("ABC").indexOf("A") > -1) // A is in the string
if(String("ABC").indexOf("B") > -1) // B is in the string
So you can just build a loop that goes thru your other String (CAB) and test each character using one line of the the code above with the indexOf argument being a variable
Another option would be to sort both sets you want to compare in arrays and then see if they are equal one for one.
Europe, Middle East and Africa