in reply to Re^3: How do I reverse the order of the first and last word of a string?
in thread How do I reverse the order of the first and last word of a string?
$s = 'Two words'; $s =~ s[(^\S+)(\s.*\s)(\S+$)][$3$2$1]; print $s; #Two words
Oops! ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How do I reverse the order of the first and last word of a string?
by BrowserUk (Patriarch) on Mar 11, 2007 at 13:32 UTC |