> -----Original Message----- > From: Liss, Mike [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 17, 2003 10:21 AM > To: [EMAIL PROTECTED] > Subject: determining location of character in array.... > > > Hello, > > Is there an easy way to get the location of a specific instance of a > character > in an array? > > for example: > > $MyArray = "This is the test"; > > I would like to know the index of the first occurence of the > letter "h" ( 1 > ) >
perldoc -f index <snip> use strict; my $s = 'This is a test'; my $i = index($s,'h'); print $i; </snip> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]