\Header{strsplit}{Split the Strings in a Vector}
\keyword{character}{strsplit}
\begin{Description}\relax
Split the strings in \code{x} into substrings according to the
presence of substring \code{split} within them.\end{Description}
\begin{Usage}
\begin{verbatim}strsplit(x, split)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] character vector, to be split.
\item[\code{split}] character string containing a regular expression to use
as ``split''.  If empty matches occur, in particular if \code{split}
has length 0, \code{x} is split into single characters.  If
\code{split} is a vector, it is re-cycled along \code{x}.
\end{ldescription}
\end{Arguments}
\begin{Value}
A list of length \code{length(x)} the \code{i}-th element of which
contains the vector of splits of \code{x[i]}.\end{Value}
\begin{SeeAlso}\relax
\code{\Link{paste}} for the reverse,
\code{\Link{grep}} and \code{\Link{sub}} for string search and
manipulation; further \code{\Link{nchar}}, \code{\Link{substr}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
noquote(strsplit("A text I want to display with spaces", NULL)[[1]])

x <- c("asfef", "qwerty", "yuiop[", "b", "stuff.blah.yech")
# split x on the letter e
strsplit(x,"e")

unlist(strsplit("a.b.c", "."))
## [1] "" "" "" "" ""
## Note that `split' is a regexp!
## If you really want to split on `.', use
unlist(strsplit("a.b.c", "\\."))
## [1] "a" "b" "c"
\end{ExampleCode}
\end{Examples}

