strcmpi
Compare strings (case insensitive)
Syntax
Description
compares
tf = strcmpi(s1,s2)s1 and s2, ignoring any differences in
letter case, and returns 1 (true) if the two
are identical and 0 (false) otherwise. Text is
considered identical if the size and content of each are the same, aside from case.
The return result tf is of data type
logical.
The input arguments can be any combination of string arrays, character vectors, and cell arrays of character vectors.
Examples
Input Arguments
Output Arguments
Tips
The
strcmpifunction is intended for comparison of text. If used on an unsupported data type,strcmpialways returns0.For case-sensitive text comparison, use
strcmpinstead ofstrcmpi.Although
strcmpishares a name with a C function, it does not follow the C language convention of returning0when the text inputs match.
Extended Capabilities
Version History
Introduced before R2006a