Perl functions references-index Function - Perl Scripting

What is Perl index Function?

Description

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.

Syntax

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).

Example

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 DMCA.com Protection Status

Perl Scripting Topics