Hey, please i need help with a project im working on. Its about functions and i don't quite understand it.

*Name of function and its parameter*
index(string,pattern,caseSensitive)

*Description*
returns the index where pattern starts in string (or -1 if not found). The search is to be case sensitive if the 3rd parameter is true otherwise it is case insensitive.

*Examples*
index("abAB12","AB",true) returns 2 but index("abAB12","AB",false) returns 0
index("abAB12","BA",true) returns -1 and index("abAB12","BA",false) returns 1

Thanks!