Learn R Programming

umx (version 1.9.1)

umx_trim: Trim whitespace surrounding a string.

Description

Returns string w/o leading or trailing whitespace

Usage

umx_trim(string, removeThis = NULL)

Arguments

string

to trim

removeThis

if not NULL then this string is removed wherever found in 'string'

Value

- string

References

- http://tbates.github.io, https://github.com/tbates/umx

See Also

Other String Functions: umx_explode_twin_names, umx_explode, umx_grep, umx_rot

Examples

Run this code
# NOT RUN {
umx_trim(" dog") # "dog"
umx_trim("dog ") # "dog"
umx_trim("\t dog \n") # "dog"
umx_trim("xlsx dog.xlsx", "\\.xlsx$") # "dog"
# }

Run the code above in your browser using DataLab