Learn R Programming

bruceR (version 0.8.5)

cc: Split up a string (with separators) into a character vector.

Description

Split up a string (with separators) into a character vector (whitespace around separator is trimmed).

Usage

cc(x, sep = "auto")

Arguments

x

Character string.

sep

Pattern for separation.

Default is "auto", including 5 common separators: , ; | \n \t.

Value

Character vector.

Examples

Run this code
# NOT RUN {
cc("a,b,c,d,e")

cc(" a , b , c , d , e ")

cc("1, 2, 3, 4, 5")

cc("A 1 , B 2 ; C 3 | D 4 \t E 5")

cc("
American
British
Chinese
")

# }

Run the code above in your browser using DataLab