R/strEndsWith.R

strEndsWith <- function(haystack, needle)
{
  hl <- nchar(haystack)
  nl <- nchar(needle)
  if(nl > hl)
  {
    return(FALSE)
  } else
  {
    return(substr(haystack, hl-nl+1, hl) == needle)
  }
}
RaikOtto/GeneraPipe documentation built on May 8, 2019, 8:02 a.m.