Learn R Programming

matlab (version 1.0.2)

strcmp: MATLAB strcmp function

Description

Compare strings.

Usage

strcmp(S, T)

Arguments

S, T
character vectors to evaluate

Value

Returns TRUE if S is identical to T; otherwise, FALSE.

Details

Comparisons are case-sensitive and any leading and trailing blanks in either of the strings are explicitly included in the comparison.

Examples

Run this code
strcmp("foo", "bar")  # FALSE
strcmp(c("yes", "no"), c("yes", "no"))	# TRUE

Run the code above in your browser using DataLab