Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

umx_trim

Trim whitespace surrounding a string.


Description

Returns string without leading or trailing whitespace, like the php function. See also built-in base::trimws() does the same.

Usage

umx_trim(string, removeThis = NULL)

Arguments

string

to trim

removeThis

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

Value

  • string

References

See Also

Examples

umx_trim(" dog") # "dog"
trimws(" dog ", "l") # added by R in v 3.3.0
umx_trim("dog ") # "dog"
umx_trim("\t dog \n") # "dog"
umx_trim("xlsx dog.xlsx", "\\.?xlsx ?") # "dog"

umx

Structural Equation Modeling and Twin Modeling in R

v4.10.10
GPL-3
Authors
Timothy C. Bates [aut, cre] (<https://orcid.org/0000-0002-1153-9007>), Gillespie Nathan [wit], Michael Zakharin [wit], Brenton Wiernik [ctb], Joshua N. Pritikin [ctb], Michael C. Neale [ctb], Hermine Maes [ctb]
Initial release
2021-11-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.