Learn R Programming

operators (version 0.1-8)

patternDivision: Divide by a pattern

Description

split a character vector by a regular expression

Usage

txt %/~% rx

Value

A character vector. For convenience, this function does not return a list as strsplit does.

Arguments

txt

text to manipulate

rx

regular expression

Author

Romain Francois <francoisromain@free.fr>

See Also

Examples

Run this code
  "Separate these  words by spaces" %/~% " +"
  
  ### From ?strsplit
  unlist(strsplit("a.b.c", "\\."))
  "a.b.c" %/~% "\\."
  

Run the code above in your browser using DataLab