https://github.com/cran/pracma
Raw File
Tip revision: c79a04b5074656b36e591191eb8137b70a349932 authored by Hans W. Borchers on 30 June 2014, 00:00:00 UTC
version 1.7.0
Tip revision: c79a04b
strcmp.Rd
\name{strcmp}
\alias{strcmp}
\alias{strcmpi}
\title{String Comparison}
\description{
  Compare two strings or character vectors for equality.
}
\usage{
strcmp(s1, s2)
strcmpi(s1, s2)
}
\arguments{
  \item{s1, s2}{character strings or vectors}
}
\details{
  For \code{strcmp} comparisons are case-sensitive, while for \code{strcmpi}
  the are case-insensitive. Leading and trailing blanks do count.
}
\value{
  logical, i.e. \code{TRUE} if \code{s1} and \code{s2} have the same length
  as character vectors and all elements are equal as character strings, else
  \code{FALSE}.
}
\seealso{
\code{\link{strcat}}
}
\examples{
strcmp(c("yes", "no"), c("yes", "no"))
strcmpi(c("yes", "no"), c("Yes", "No"))
}
\keyword{ string }
back to top