Write a Ruby program to sort a string's characters alphabetically.
def check_string(str) return str.chars.sort.join end print check_string("javascript") print "\n",check_string("python") print "\n",check_string("PHP")
Output:
aacijprstv hnopty HPP
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer