Sort Characters of String - Alphabetically
HOw to sort the Characters of a String Alphabetical order.
looking for the algorithm
if the String is "SAMPLE" (String s = "SAMPLE")
need to get the answer as "AELMPS"
Message was edited by:
jugp
HOw to sort the Characters of a String Alphabetical order.
looking for the algorithm
if the String is "SAMPLE" (String s = "SAMPLE")
need to get the answer as "AELMPS"
Message was edited by:
jugp
try converting the string to an array of the letters, sort the array, and then convert the sorted array back into a string. you should be able to figure out the rest. Look at the API for String for the methods you need.
~Tim