Perl functions references-index Function - Perl Scripting

What is Perl index Function?


This function returns the position of the first occurrence of SUBSTR in STR, starting at the beginning (starting at zero), or from POSITION if specified.


Following is the simple syntax for this function −

Return Value

This function returns -1 on failure, or else Position of matching string (starting at zero for the first character).


Following is the example code showing its basic usage −
When above code is executed, it produces the following result −

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Perl Scripting Topics