MATLAB Function Reference | ![]() ![]() |
Find one string within another
Syntax
k = findstr(str1
,str2
)
Description
k = findstr(
finds the starting indices of any occurrences of the shorter string within the longer.str1
,str2
)
Examples
str1 = 'Find the starting indices of the shorter string.'; str2 = 'the'; findstr(str1,str2) ans = 6 30
See Also
![]() | findobj | finish | ![]() |