substr
Extract substring from string
Description
returns the substring of newStr
= substr(str
,pos
,length
)str
that starts at the character
position pos
and is length
characters
long. Use zero-based indexing.
Note
The operator substr
is supported only in Stateflow® charts that use C as the action language. In charts that use
MATLAB® as the action language, use extractAfter
or extractBefore
.
Examples
Tips
Use zero-based indexing.
Enclose literal strings with single or double quotes.
Version History
Introduced in R2018b