View source: R/normalize_whitespace.R
strs_normalize_whitespace | R Documentation |
strs_normalize_whitespace
normalizes the whitespace in each element of a
character vector. It trims leading and trailing whitespace and replaces any
sequence of whitespace characters within the string with a single space. This
function is akin to the typical Python pattern " ".join(str.split())
.
strs_normalize_whitespace(string)
string |
A character vector where each element is a string in which to normalize whitespace. |
A character vector of the same length as string
, with whitespace
normalized in each element.
strs_normalize_whitespace(" hello world ")
strs_normalize_whitespace("\thello\nworld\t")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.