vroom has asked for the wisdom of the Perl Monks concerning the following question:
Use reverse in scalar context. It just reverses by bytes
or characters. In a list context it will reverse the
elements of a list:
$revstr = reverse($str); # reversed by character $revwords = join(" ", reverse split(/ /, $str));
Originally posted as a Categorized Question.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do I reverse a string or the words in a string?
by ariels (Curate) on Dec 03, 2000 at 17:21 UTC | |
Re: How do I reverse a string or the words in a string?
by pokemonk (Scribe) on Jul 21, 2001 at 04:16 UTC | |
by wine (Scribe) on Jul 21, 2001 at 14:19 UTC | |
Re: How do I reverse a string or the words in a string?
by Anonymous Monk on Apr 16, 2004 at 03:51 UTC | |
Re: How do I reverse a string or the words in a string?
by Anonymous Monk on Dec 24, 2002 at 01:24 UTC | |
Re: How do I reverse a string or the words in a string?
by Anonymous Monk on Jan 31, 2003 at 13:51 UTC | |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Back to
Seekers of Perl Wisdom