strTrim: strTrim

Description Usage Arguments Details Value See Also Examples

View source: R/rpraat.R

Description

Trim leading and trailing whitespace in character string.

Usage

1
strTrim(string)

Arguments

string

character string

Details

Like str_trim() in stringr package or trimws() in R3.2.0 but way faster.

Source: Hadley Wickham comment at http://stackoverflow.com/questions/2261079/how-to-trim-leading-and-trailing-whitespace-in-r

Value

returns a character string with removed leading and trailing whitespace characters.

See Also

isString for testing whether it is 1 character vector, str_contains for finding string in string without regexp, str_find for all indices without regexp, str_find1 for the first index withoud regexp.

Examples

1
strTrim("      Hello World!    ")

rPraat documentation built on Dec. 9, 2018, 1:04 a.m.