Learn R Programming

matlab (version 1.0.4.1)

strcmp: MATLAB strcmp function

Description

Compare strings.

Usage

strcmp(S, T)

Value

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

Arguments

S, T

character vectors to evaluate

Author

P. Roebuck proebuck1701@gmail.com

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