PLAYGROUND (experimental)

str_find

Returns the position of first occurrence of pattern in string, or -1 if not found.
str_find(
    str, 
    pattern
) -> NUMBER

Returns the position of first occurrence of pattern in string, or -1 if not found.

Syntaxe

var result = str_find("Hello World", "World");  // 6\nvar result2 = str_find("Hello World", "xyz");   // -1

Arguments

NameTypeRequiredDefaultDescription
stryes-String to search in
patternyes-Substring to find