Swap the position of letters in 1 word

I have a text label ABCDE, how do I come up with a random sorted string?
The result can be EDBCA, ADECB,…

This is 1 good solution. But is there a way when the result will not duplicate 3 characters from the old text label?
Ex: ABCDEF if the result is ABCFED or AFCDEB will automatically give another result because it matches the 3 characters ABC and CDE with the old text label.