Vectorized over str
and pattern
.stri_trim
is a convenience function, which dispatches
control to stri_trim_*
. Unless you are very lazy, do not use it:
it is a little bit slower.
Contrary to many other string processing libraries,
our trimming functions are quite general. A character class,
given by pattern
,
may be adjusted to suit your needs (most often you will use the default
value).
Interestingly, with these functions you may sometimes extract data, which
in some cases require using regular expressions. E.g. you may get
"23.5"
out of "total of 23.5 bitcoins"
.
For trimming whitespaces, please note the difference
between Unicode binary property `\p{Wspace}
` (more general)
and general character category `\p{Z}
`,
see stringi-search-charclass.