in reply to cut of first char of a string
Well, here's a couple of simple ones:
Although, I'm honestly not sure why the $s= that immediately precedes the do is necessary in the second one. Can anyone explain it to me?print join'',@{[do{shift@{$s=[split//,$s='foobarbaz']};@$s}]} print $s=reverse@{$s=do{pop @{$s=[split//,reverse$s='foobarbaz']};$s}}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: cut of first char of a string
by ambrus (Abbot) on Jul 04, 2005 at 08:47 UTC |