strfind
Find a string in another.
📝Syntax
occ = strfind(str, pattern)
occ = strfind(str, pattern,'ForceCellOutput', ouput)
📥Input Arguments
Parameter Description
str a string or cell of strings.
pattern a string to find.
output a logical.
📤Output Arguments
Parameter Description
occ a cell or matrix of integer values: occurences position.
📄Description

strfind finds a string in another.

💡Examples
str = 'To make a mountain out of a molehill';
k = strfind (str, 'in')
k= strfind(str, ' ')
k = strfind ({'abababada', 'beabebe', 'ab'}, 'aba')

A = {'Nel', 'son'; 'Toolboxes', 'Modules'}
k = strfind(A, 'o')

str = 'No pain no gain.';
k = strfind(str,'in','ForceCellOutput',true)
k = strfind(str,'in','ForceCellOutput',false)
🔗See Also
strcmp
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub