View source: R/str_to_shortcut.R
| str_to_shortcut | R Documentation |
Given a character vector, each element is split, the first
nchars characters are extracted from each part and all parts are
concatenated with sep.
This is useful to obtain shortcuts of lengthy strings.
str_to_shortcut(x, split, nchars = 1, sep = "-", ...)
x |
[ |
split |
[ |
nchars |
[ |
sep |
[ |
... |
[ |
Shortcut version of x.
Other string helpers:
str_parse()
x = c("hello-world", "some-length-string")
str_to_shortcut(x, split = "-")
str_to_shortcut(x, nchars = 2L, sep = "", split = "-")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.