Revision 53ffd7bf5e276f98a557e92e1db3a1898b44d04c authored by Gregory R. Warnes on 28 April 2015, 00:00:00 UTC, committed by Gabor Csardi on 28 April 2015, 00:00:00 UTC
1 parent 4a0c279
Raw File
startsWith.R
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
  }
back to top