On Wed, 5 Sep 2012 14:33:13 +0100
jet speed <speedj...@googlemail.com> wrote:

> Hi All,
> 
> i have an regx question. i have the array contents, now i want to
> remove the first 2 characters (fc) of each element in the array and
> store it in a second array ex: @array2
> 
> @array ="fc20/1, fc30/22, fc40/3, fc20/1";
> 
> output
> 
> @array2 ="20/1, 30/22, 40/3, 20/1";
> 
> please advice.

It would be helpful if you posted actual Perl code.

Try:

    # remove the first 2 characters from every element of the array
    my @array2 = map { s/^..//msx } @array1;


-- 
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

        _Perl links_
official site   : http://www.perl.org/
beginners' help : http://learn.perl.org/faq/beginners.html
advance help    : http://perlmonks.org/
documentation   : http://perldoc.perl.org/
news            : http://perlsphere.net/
repository      : http://www.cpan.org/
blog            : http://blogs.perl.org/
regional groups : http://www.pm.org/

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to