Main Content

strcmpi

Compare strings in Stateflow chart (case insensitive)

Since R2021b

Description

tf = strcmpi(str1,str2) compares strings str1 and str2, ignoring differences in letter case. The operator returns 1 (true) if the strings are identical and 0 (false) otherwise.

example

Note

The operator strcmpi is not supported in Stateflow® charts that use C as the action language.

Examples

expand all

Set x to 0 (false) because the strings do not match. Set y to 1 (true) because the strings match when you ignore case.

str1 = "Hello, World!";
str2 = "hello, world!";
x = strcmp(str1,str2);
y = strcmpi(str1,str2);

Stateflow chart that uses the strcmpi operator in a state.

Input Arguments

expand all

Input strings, specified as string scalars. Enclose literal string with double quotes.

Example: "Hello"

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

Go to top of page