Learn R Programming

textTools (version 0.1.0)

str_rm_blank_space: Remove and replace excess white space from strings.

Description

Remove and replace excess white space from strings.

Usage

str_rm_blank_space(x, replacement = " ")

Arguments

x

A vector or string.

replacement,

A string to replace the blank space with, defaults to " ", which replaces excess space with a single space.

Value

x, with extra white space removed/replaced.

Examples

Run this code
# NOT RUN {
str_rm_blank_space(c("this     is   a test.  ", "    will it    work? "))
# }

Run the code above in your browser using DataLab