Function cras::appendIfNonEmpty

Function Documentation

::std::string cras::appendIfNonEmpty(const ::std::string &str, const ::std::string &suffix)

If str is nonempty, returns str + suffix, otherwise empty string.

Parameters:
  • str[in] The main string.

  • suffix[in] The string’s suffix.

Returns:

The possibly suffixed string.