OK, I missed part of what you were saying, your first message said that the words should be sorted, the code I gave sorts the words.
If you want all possible combinations of the set of words, the basic structure of what I gave is OK, since it extracts the words from the text, but you will need to add some code to generate the other combinations.
Obviously there are going to be an awful lot of combinations for anything but a small number of words.
0
redgreenredAuthor Commented:
the code is only breaking a string into three parts and then doing the sorting.
My requirement was to convert the string like this