string sort()

C

Chris

How could i possibly sort this my $mystring = "this"
and make it look like my $mystring = "hist"
 
G

Gunnar Hjalmarsson

Chris said:
How could i possibly sort this my $mystring = "this"
and make it look like my $mystring = "hist"

$mystring = join '', sort split //, $mystring;
 
J

Jürgen Exner

Chris said:
How could i possibly sort this my $mystring = "this"
and make it look like my $mystring = "hist"

Guessing here (one single example is not a very good way to describe the
expected behaviour of a generic algorithm), but do you want to sort the
characters of a string? In that case:
- perldoc -f split
- perldoc -f sort
- perldoc -f join

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,168
Messages
2,570,914
Members
47,455
Latest member
Delilah Code

Latest Threads

Top