find function

Syntax

float find(inputString, matchString, n)

Parameters

Returns

Index of nth occurrence of matchString in inputString or -1 if not found.

Description

This function returns the index of the of the nth occurrence of the matchString in the inputString.

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.

Copyright ©2008-2023 Esri R&D Center Zurich. All rights reserved.