I think , this is like : index( $string, 'at', index( $string, 'at' ) +
1); Please let me know , if I am wrong.

Thanks
Sunita

-----Original Message-----
From: Shawn H Corey [mailto:shawnhco...@gmail.com] 
Sent: Wednesday, January 26, 2011 10:44 PM
To: beginners@perl.org
Subject: Re: string index fucntion

On 11-01-26 11:53 AM, Sunita Rani Pradhan wrote:
>              There is a sting as : "The cat is sat on the mat" .
>
> I want  to get index of  second occurrence of    "at" using index
> function . Can it be  possible?

Yes.

my $second_at = index( $string, 'at', index( $string, 'at' ));


-- 
Just my 0.00000002 million dollars worth,
   Shawn

Confusion is the first step of understanding.

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

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.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