This help topic is for R version 0.90. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/strsplit.html
strsplit {base}R Documentation

Split the Strings in a Vector

Description

Split the Strings in x into substrings according to the presence of substring split within them.

Usage

strsplit(x,split)

Arguments

x

character vector, to be split.

split

character string, to use as "split". If split has length 0, x is split into single characters. If split is a vector, it is re-cycled along x.

Value

A list of length length(x) the i-th element of which contains the vector of splits of x[i].

See Also

paste for the reverse, grep and sub for string search and manipulation; further nchar, substr.

Examples

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")

[Package base version 0.90 ]