Comparing two strings
To check for an exact match, use strcmp().
if strcmp(a,b) % They're the same! else % They're different. end
To do case insensitive comparisons, use strcmpi().
strcmpi('Foo', 'foO') % returns 1
To check for an exact match, use strcmp().
if strcmp(a,b) % They're the same! else % They're different. end
To do case insensitive comparisons, use strcmpi().
strcmpi('Foo', 'foO') % returns 1