Return the position of the first occurrence of the string t in the string s, or 0 if no occurrence is found. For example,
index ("Teststring", "t") 4If direction is ‘"first"’, return the first element found. If direction is ‘"last"’, return the last element found. The
rindexfunction is equivalent toindexwith direction set to ‘"last"’.Caution: This function does not work for arrays of character strings.