Re: About the perl index function question

2009-12-09 Thread Alan Haggai Alavi
Hi, index $s, "e", 3; This means "position of the first 'e' on or after position 3". The position of the 'e' is counted from the start of the string. Counting starts from 0. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@p

Re: About the perl index function question

2009-12-08 Thread Majian
Thanks Dermot and erez.schatz I got it ~ On Tue, Dec 8, 2009 at 4:59 PM, Erez Schatz wrote: > 2009/12/8 Majian : > > my $s = "The black cat jumped from the green tree"; > > print index $s, "e", 3 The result is 18 > > It's slightly confusing, but if you get the idea behind it, it's > actuall

Re: About the perl index function question

2009-12-08 Thread Erez Schatz
2009/12/8 Majian : > my $s = "The black cat jumped from the green tree"; > print index $s, "e", 3 The result is 18 It's slightly confusing, but if you get the idea behind it, it's actually very simple: counting from 0, the string "The black cat jumped from the green tree" has an 'e' at the 2