Skip to content

Rose::StringUtility::trim

Trims white space from the beginning and end of a string.

Synopsis

Declared in <src/Rose/StringUtility/Convert.h>

[[visibility("default")]]
std::string
trim(
    std::string const& str,
    std::string const& strip = " \t\r\n",
    bool at_beginning = true,
    bool at_end = true);

Description

Caller may specify the characters to strip and whether the stripping occurs at the begining, the end, or both.

Return Value

Trimmed string.

Parameters

Name Description
str Input string.
strip Characters to strip.
at_beginning Trim from the beginning.
at_end Trim from the end.

Created with MrDocs