trimCopy#

Fully qualified name: omni::extras::trimCopy

Defined in omni/extras/StringHelpers.h

inline std::string omni::extras::trimCopy(
std::string s,
const char *t = kTrimCharsDefault,
)#

Performs a trim (from both sides) on a given string, returning a copy.

This will trim the characters in t from both sides of s. e.g. given s = "  asdf  " with the default t value, "asdf" would be returned. This is effectively std::string copy(s); return trim(copy);.

See also

ltrim(), rtrim(), trim()

Parameters:
  • s – The string to trim

  • t – A string containing the list of characters to trim (such as kTrimCharsDefault)

Returns:

The trimmed string