[#absl-ConsumePrefix] = xref:absl.adoc[absl]::ConsumePrefix :relfileprefix: ../ :mrdocs: Strips the `expected` prefix, if found, from the start of `str`. If the operation succeeded, `true` is returned. If not, `false` is returned and `str` is not modified. == Synopsis Declared in `<absl/strings/strip.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool ConsumePrefix( std::string_view* str, std::string_view expected); ---- == Description Example: absl::string_view input("abc"); EXPECT_TRUE(absl::ConsumePrefix(&input, "a")); EXPECT_EQ(input, "bc"); == Return Value `true` if the prefix was found and removed, `false` otherwise. == Parameters [cols="1,4"] |=== | Name| Description | *str* | The string to strip the prefix from in place. | *expected* | The prefix to remove. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#