str_split_one: Split a string

Description Usage Arguments Value Examples

View source: R/str_split_one.R

Description

Split a string

Usage

1
str_split_one(string, pattern, n = Inf)

Arguments

string

A character vector with, at most, one element.

pattern

The character to split on.

n

Some number for something.

Value

A character vector.

Examples

1
2
3
4
5
6
x <- "alfa,bravo,charlie,delta"
str_split_one(x, pattern = ",")
str_split_one(x, pattern = ",", n = 2)

y <- "192.168.0.1"
str_split_one(y, pattern = stringr::fixed("."))

EleanorLee42/regexcite documentation built on Feb. 1, 2022, 12:22 a.m.