str_trim {stringr}R Documentation

Trim whitespace from start and end of string.

Description

Trim whitespace from start and end of string.

Usage

  str_trim(string, side = "both")

Arguments

string

input character vector

side

side on which whitespace is removed (left, right or both)

Value

character vector with leading and trailing whitespace removed

See Also

str_pad to add whitespace

Examples

str_trim("  String with trailing and leading white space\t")
str_trim("\n\nString with trailing and leading white space\n\n")

[Package stringr version 0.6.2 Index]