strncmp
Compare first n
characters of strings (case
sensitive)
Syntax
Description
compares up to tf
= strncmp(s1,s2
,n
)n
characters of s1
and
s2
. The function returns 1
(true
)
if the two are identical and 0
(false
) otherwise. Text
is considered identical if the content of each is the same up to the end or the first
n
characters, whichever comes first.
Note
The operator strncmp
is supported only in Stateflow® charts that use MATLAB® as the action language.
Examples
Limitations
This operator is not supported for use with structures. For more information about structures in Stateflow, see Access Bus Signals Through Stateflow Structures.