Skip to content

Flatten a string

Usage

str_flatten(string, collapse = "")

Arguments

string

Character to flatten

collapse

String to insert between each piece

Value

A character vector of length 1

Examples

str_flatten(letters)
#> [1] "abcdefghijklmnopqrstuvwxyz"
str_flatten(letters, "-")
#> [1] "a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z"