MATLAB Function Reference |
Compare strings, ignoring case
Syntax
Description
strcmpi(str1, str2)
returns logical 1
(true
) if strings str1
and str2
are the same except for case and logical 0
(false
) otherwise.
strcmpi(S, T)
when either S
or T
is a cell array of strings, returns an array the same size as S
and T
containing logical 1
(true
) for those elements of S
and T
that match except for case, and logical 0
(false
) otherwise. S
and T
must be the same size (or one can be a scalar cell). Either one can also be a character array with the right number of rows.
Remarks
strcmpi
is intended for comparison of character data. When used to compare numeric data, strcmpi
returns logical 0
.
strcmpi
supports international character sets.
See Also
strcmp
, strncmpi
, strncmp
, strmatch
, strfind
, findstr
, regexp
, regexp
i, regexprep
strcmp | stream2 |
© 1994-2005 The MathWorks, Inc.