Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Compare strings

- example
`tf = strcmp(s1,s2)`

compares `tf`

= strcmp(`s1,s2`

)`s1`

and `s2`

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. The return result `tf`

is of data
type `logical`

.

Inputs can be combinations of string arrays, character vectors, and cell arrays of character vectors.

Was this topic helpful?