Skip to content

Commit b96a417

Browse files
committed
Tweak str_squish() docs
And fix styling. Fixes #477
1 parent b0618cd commit b96a417

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

R/trim.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#' Remove whitespace
22
#'
33
#' `str_trim()` removes whitespace from start and end of string; `str_squish()`
4-
#' also reduces repeated whitespace inside a string.
4+
#' removes whitespace at the start and end, and replaces all internal whitespace
5+
#' with a single space.
56
#'
67
#' @inheritParams str_detect
78
#' @param side Side on which to remove whitespace: "left", "right", or
8-
#' "both", the default..
9+
#' "both", the default.
910
#' @return A character vector the same length as `string`.
1011
#' @export
1112
#' @seealso [str_pad()] to add whitespace
@@ -28,5 +29,5 @@ str_trim <- function(string, side = c("both", "left", "right")) {
2829
#' @export
2930
#' @rdname str_trim
3031
str_squish <- function(string) {
31-
stri_trim_both(str_replace_all(string,"\\s+"," "))
32+
stri_trim_both(str_replace_all(string, "\\s+", " "))
3233
}

man/str_trim.Rd

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)