strcmp | R Documentation |
Compare two strings or character vectors for equality.
strcmp(s1, s2)
strcmpi(s1, s2)
s1, s2 |
character strings or vectors |
For strcmp
comparisons are case-sensitive, while for strcmpi
the are case-insensitive. Leading and trailing blanks do count.
logical, i.e. TRUE
if s1
and s2
have the same length
as character vectors and all elements are equal as character strings, else
FALSE
.
strcat
strcmp(c("yes", "no"), c("yes", "no"))
strcmpi(c("yes", "no"), c("Yes", "No"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.