IndexOf

From Catglobe Wiki
Revision as of 05:21, 14 August 2024 by Administrator (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


indexOf

Returns a 0-based index of the first occurrence of a string in another string. Returns empty if there are no occurrences found.

Syntax

indexOf(stringToSearchFor, stringToSearchIn)

Arguments

stringToSearchFor: is a string expression.

stringToSearchIn: is a string expression.

Return type

number

Example

number result =indexOf("is", "catglobe is tHe beSt");

print(result);

//9

Availability

Version 5.2