Main Content
strncmp
Compare first N characters of strings in Stateflow chart (case sensitive)
Since R2021b
Description
compares the first tf
= strncmp(str1
,str2
,n
)n
characters of str1
and
str2
. The operator returns 1
(true
) if the strings are identical and 0
(false
) otherwise.
Note
The operator strncmp
is not supported in Stateflow® charts that use C as the action language. For similar functionality, use
strcmp
.
Examples
Input Arguments
Limitations
This operator does not support the use of Stateflow structure fields or messages. For more information about structures in Stateflow, see Access Bus Signals.
Version History
Introduced in R2021b