R/startsWith.R

Defines functions startsWith

Documented in startsWith

startsWith <- function(str, pattern, trim=FALSE, ignore.case=FALSE)
  {
    if(trim) str <- trim(str)

    if(ignore.case)
      {
        str <- toupper(str)
        pattern <- toupper(pattern)
    }

    #substr(str,start=1,stop=nchar(pattern))==pattern

    base::startsWith(str, pattern)
  }

Try the gdata package in your browser

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

gdata documentation built on May 2, 2019, 5:49 p.m.