R/strcmp.R

Defines functions strcmp

Documented in strcmp

###
### $Id: strcmp.R 29 2022-05-30 23:02:22Z proebuck $
###
### Compare strings.
###


##-----------------------------------------------------------------------------
strcmp <- function(S, T) {
    if (!is.character(S)) {
        stop(sprintf("argument %s must be character", sQuote("S")))
    }
    if (!is.character(T)) {
        stop(sprintf("argument %s must be character", sQuote("T")))
    }

    if (length(S) == length(T)) {
        all(S == T)
    } else {
        FALSE
    }
}

Try the matlab package in your browser

Any scripts or data that you put into this service are public.

matlab documentation built on July 1, 2024, 5:07 p.m.