R/str_nonascii.R

Defines functions str_nonascii

Documented in str_nonascii

.REGEX_nonascii = "[^\\x00-\\x7F]"

#' Check for any non-ASCII characters
#'
#' @param x vector of strings
#' @param ... additional arguments passed to `base::grepl`
#'
#' @return a logical vector the same length as x
#' @export
str_nonascii <- function(x, ...) {
	grepl(.REGEX_nonascii, x , perl = TRUE, useBytes = TRUE, ...)
}
stackcon/rngt documentation built on June 17, 2022, 5:29 p.m.