% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/whitespace.r
\name{anyZchar}
\alias{anyZchar}
\alias{anyWS}
\title{Are any zero char or all whitespace elements present?}
\usage{
anyZchar(x)

anyWS(x, zchar = FALSE)
}
\arguments{
\item{x}{a character vector.}

\item{zchar}{if \code{TRUE} then zero character elements
will be treated as all whitespace.}
}
\value{
an integer or real vector of length one with value
the \code{1}-based index of the first zero char/all whitespace value
if any, otherwise \code{0}.
}
\description{
Tests if a character vector contains any zero character
or all whitespace elements.
}
\details{
\code{anyZchar()} and \code{anyWS()} return an index immediately when
encountering a zero character or a whitespace element,
respectively.

Whitespace elements are defined as any character that is a
space, horizontal tab, carriage return or newline,
aka \code{"[ \\t\\r\\n]"}. See \link{trimws} for more details and how to
instead match all unicode whitespace.

\code{anyZchar()} implements the same definition of a zero char
as \code{\link{nzchar}}.

\code{NA_character_} is not considered zero char or all whitespace.
}
\note{
Unlike the similar base functions, these do not coerce
the input to character.
}
\examples{
anyZchar(c("hi", "bye", " ", ""))
anyWS(c("hi", "bye", " ", ""))
anyWS(c("hi", "bye", "who", ""), zchar = TRUE)
}
\seealso{
\link{nzchar}, \link{trimws}, \link{anyNF}
}
