Putting a word in alphabetical order.
I'm trying to put a word into alphabetical order (i.e. so that the letters contained within are in alphabetical order), but do you have any idea how I would do this with a word of unknown length?
I can think how to do it with one character and the character next to it using a for loop, but not so it checks the other letters in the sequence against it.
If you have any ways about how to do this then I would appreciate it.
For example I'm trying to write it so that:
ball would become abll, but also so that program would become agmoprr, and so on and so forth for any length word.