find function

float find(inputString, matchString, n)

inputString string

matchString string

n float

Returns the index of the nth occurrence of the matchString in the inputString or -1 if not found.

Note: Index n is 0-based.

Related

Examples

find("CE_Zero CE_One CE_Two", "CE", 0)
# result = 0

find("CE_Zero CE_One CE_Two", "CE", 1)
# result = 8

find("cityengine rocks my world; cityengine should rock yours too", "cityengine", 0)
# result = 0

find("cityengine rocks my world; cityengine should rock yours too", "cityengine", 1)
# result = 27

find("CE_Zero CE_One CE_Two", "asdf", 1)
# result = -1
# no match found.