Main Content

strcmpi

Compare strings in Requirements Table block (case insensitive)

Since R2022b

Description

example

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. Use this operator in the Requirements Table block.

Examples

expand all

In a Requirements Table block, create a requirement that checks if the strings "abc" and "ABC" are equal, ignoring case.

y = strcmpi("abc","ABC")

This example shows a requirement that checks if the strings "abc" and "abc" are equal, ignoring case.

Input Arguments

expand all

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

Example: "Hello"

Data Types: string

Limitations

  • This operator does not support the use of Simulink.Bus object fields.

Version History

Introduced in R2022b