in reply to Re^2: Swap the characters
in thread Swap the characters
I don't know how I came to forget about using a negative offset with substr. Thanks for pointing it out.
$ perl -le ' $str = q{yands}; substr( $str, 0, 1 ) = substr $str, -1, 1, substr $str, 0, 1; print $str;' sandy $
Cheers,
JohnGG
|
|---|