stringr (version 0.2)

str_trim: Trim whitespace from start and end of string.

Description

Trim whitespace from start and end of string.

Usage

str_trim(string)

Arguments

string
input character vector

Value

  • character vector with leading and trailing whitespace removed

Examples

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

Run the code above in your browser using DataCamp Workspace