Name
index
Synopsis
index string, substr, [start]
Returns the position of the first occurrence of
substr
in
string
. The
start
, if specified, specifies the
position to start looking in the string. Positions are integer
numbers based at 0
. If the
substring is not found, the index
function returns -1
.
Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.