strcmp

strcmp(str1,str2) returns 1 (true) if string str1 is identical to str2 and 0 (false) otherwise. Arguments can also be cell array of strings.

Examples

> strcmp('Abc','abc')

[ans:false]
> s1 = 'ABCD'; s2 = {'AB' 'ABCD';'ABC' 'ABCd'};

[s1:ABCD]
[s2:2x2 cell]

> strcmp(s1,s2)#

 0
 0
 1
 0

Resources

See also

strcmpi | strncmp | strncmpi