R/nwords.R

Defines functions nwords

Documented in nwords

#' nwords
#'
#' Count number of words in string
#' @param str string or string vector 1
#' @export
nwords <- function(str) {
  length(unlist(strsplit(trimws(rm_white(str))," ")))
}
nbarsch/tfwstring documentation built on May 4, 2023, 5:26 a.m.