[#util-TrimString] = xref:util.adoc[util]::TrimString :relfileprefix: ../ :mrdocs: Return a copy of str with leading and trailing pattern characters removed. == Synopsis Declared in `<util/string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] std::string TrimString( std::string_view str, std::string_view pattern = " \f\n\r\t\v"); ---- == Return Value A new string without the leading and trailing pattern characters. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *str* | Input string. | *pattern* | Characters trimmed from both ends. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#