Learn R Programming

stringr (version 1.4.1)

str_flatten: Flatten a string

Description

Flatten a string

Usage

str_flatten(string, collapse = "")

Value

A character vector of length 1

Arguments

string

Character to flatten

collapse

String to insert between each piece

Examples

Run this code
str_flatten(letters)
str_flatten(letters, "-")

Run the code above in your browser using DataLab