the problem with making these standard is twofold. First, expectations/requirements on them vary a little. Do you trim both front and back? Internal whitespace (eg 3 spaces to 1)? Do you kill all whitespace or only spaces?
you can very easily write these with find/replace or regex or std transform etc.
Using ranges, then possibly something like this which will trim white-space from left and right of the given string and also return that trimmed value: