View source: R/str_split_one.R
str_split_one | R Documentation |
Split a string
str_split_one(string, pattern, n = Inf)
string |
A character vector of length 1. |
pattern |
Pattern to look for. The default interpretation is a regular expression, as described
in stringi::stringi-search-regex. Control options with
Match a fixed string (i.e. by comparing only bytes), using
Match character, word, line and sentence boundaries with
|
n |
number of pieces to return. Default (Inf) uses all possible split positions. For |
A character vector.
x <- "alpha, omega, start, end" str_split_one(string = x, pattern = ", ") y <- "192.168.0.1" str_split_one(string = y, pattern = stringr::fixed("."))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.