is there a way to check if a randomly ordered word equals the original?

example:
rmci

and it will play around with it and see if it can find mirc(the actual word will be given, just need it to return true or false if it == the word)