str_tokenise: Tokenise a string

View source: R/string-utils.R

str_tokeniseR Documentation

Tokenise a string

Description

Splits an input string into tokens. A wrapper for strsplit() with a predefined split regex of ⁠[^[:alnum:]]⁠, i.e. anything except ⁠[a-zA-Z0-9]⁠.

Usage

str_tokenise(x, split = "[^[:alnum:]]+")

Arguments

x

The input string. Non-character inputs will be coerced with as.character().

split

The regular expression to split on. See strsplit().

Value

A list containing one character vector for each element of x.


levitate documentation built on Oct. 1, 2023, 1:08 a.m.