Function that combines elements of a
character vector into a single string.
squish(chr_vec, between = "")
Arguments
- chr_vec
A character vector.
- between
The value to use as spacing between
each element in chr_vec
.
Value
A character string.
Examples
# Collapse a character vector
print( squish( c( "A", "B", "C" ) ) )
#> [1] "ABC"
# Collapse a characcter vector with custom spacing
print( squish( c( "1", "2", "3" ), " + " ) )
#> [1] "1 + 2 + 3"