strtok: Split strings to tokens

Description Usage Arguments Details Value Examples

View source: R/string_functions.R

Description

Split strings to tokens

Usage

1
strtok(x, split = "")

Arguments

x

A string or vector of strings

split

A delimeter on which to split strings, defaults to an empty string.

Details

An alternative to strsplit() that returns a vector if a single string, or a list if multiple. Named from c++ function to turn strings into tokens.

Value

Either a single vector of characters, or a list of split strings.

Examples

1
2
3
4
5
6
7
8
strtok("hello")
[1] "h" "e" "l" "l" "o"
strtok(c("hello","loko"))
[[1]]
[1] "h" "e" "l" "l" "o"

[[2]]
[1] "l" "o" "k" "o"

andrewjameshaynes/helpeR documentation built on May 28, 2019, 2:44 p.m.