[Israel.pm] how do i cut the first 2 characters/digits of a string?
Gaal Yahas
gaal at forum2.org
Thu Jul 15 03:51:08 PDT 2004
On Thu, Jul 15, 2004 at 01:47:49PM +0300, Shlomi Fish wrote:
> You can also do it in place using "substr":
>
> <<<
> $mystring="abcdefgh";
> substr($mystring,0,2)="";
> >>>
>
> As substr returns an lvalue.
>
> There's more than one way to do it.
Speaking of which, the following may be self-referentially fastest:
chop; chop
--
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/
More information about the Perl
mailing list