Navigation

Operators and Keywords

Function List:

C++ API

: findstr (s, t)
: findstr (s, t, overlap)

Return the vector of all positions in the longer of the two strings s and t where an occurrence of the shorter of the two starts.

If the optional argument overlap is true (default), the returned vector can include overlapping positions. For example:

findstr ("ababab", "a")
     ⇒ [1, 3, 5];
findstr ("abababa", "aba", 0)
     ⇒ [1, 5]

Caution: findstr is scheduled for deprecation. Use strfind in all new code.

See also: strfind, strmatch, strcmp, strncmp, strcmpi, strncmpi, find.

Package: octave