R/is.ASCII.R

#' is.ASCII
#'
#' Checks if \code{txt} contains only ASCII characters.
#'
#' @param txt character: text to check
#'
#' @return logical
#' @export
#'
#' @examples
#' is.ASCII("Congratulations")
#' is.ASCII("Herzlichen Glückwunsch")
is.ASCII <- function (txt) { all(charToRaw(txt) <= as.raw(127)) }

Try the HKRbook package in your browser

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

HKRbook documentation built on Oct. 6, 2022, 9:06 a.m.