in reply to Re^2: 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 = 'This is the word'; $s =~ s[(^\S+)(\s.*\s)(\S+$)][$3$2$1]; print $s; word is the This
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How do I reverse the order of the first and last word of a string?
by vrk (Chaplain) on Mar 11, 2007 at 07:23 UTC | |
by BrowserUk (Patriarch) on Mar 11, 2007 at 08:00 UTC | |
|
Re^4: How do I reverse the order of the first and last word of a string?
by Not_a_Number (Prior) on Mar 11, 2007 at 12:07 UTC | |
by BrowserUk (Patriarch) on Mar 11, 2007 at 13:32 UTC |