[#util-RemoveSuffixView] = xref:util.adoc[util]::RemoveSuffixView :relfileprefix: ../ :mrdocs: Return a view of str with the given suffix removed, if present. == Synopsis Declared in `<util/string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] std::string_view RemoveSuffixView( std::string_view str, std::string_view suffix); ---- == Return Value A view into str without the trailing suffix, or str unchanged. [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. | *suffix* | Suffix to strip when str ends with it. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#