|Programming and Data Types|
Comparing Strings For Equality
There are four functions that determine if two input strings are identical:
determines if two strings are identical.
strncmpdetermines if the first
ncharacters of two strings are identical.
strncmpiare the same as
strncmp, except that they ignore case.
Consider the two strings
str2 are not identical, so invoking
0 (false). For example,
For C programmers, this is an important difference between the MATLAB |
The first three characters of
str2 are identical, so invoking
strncmp with any value up to 3 returns
These functions work cell-by-cell on a cell array of strings. Consider the two cell arrays of strings
Now apply the string comparison functions.
|String Comparisons||Comparing for Equality Using Operators|