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