Return index of first occurrence of pattern string
Simulink / String
The String Find block returns the index of the first occurrence of the pattern string sub in the text string str.
str— String in which to find pattern
String in which to find pattern (
sub), specified as
Pattern to be found in string (
str), specified as a
idx— Position index of found pattern
Position index of the found pattern, specified as a positive integer scalar.
If the block does not find the pattern, it returns
If the sub parameter is empty
""), the block returns
1, indicating that it matched the
beginning of the searched string.
Compose String | Scan String | String Compare | String Concatenate | String Constant | String Find | String Length | String to ASCII | String to Double | String to Enum | String to Single | Substring | To String