Is there any in-built function in perl to sort characters in string like sorted() in python?
For example,
$word = "honey";
i want output as "ehnoy".
Is there any in-built function in perl to sort characters in string like sorted() in python?
For example,
$word = "honey";
i want output as "ehnoy".
You have to split string into list of chars, sort it, and join list of chars using empty string,
my $sorted = join "", sort split //, $word;
assigned ehnoy