Check whether a container begins with the given prefix.
Declared in <util/string.h>
template<
typename T1,
size_t PREFIX_LEN>
[[nodiscard]]
bool
HasPrefix(
T1 const& obj,
std::array<uint8_t, PREFIX_LEN> const& prefix);
true if obj is at least PREFIX_LEN long and starts with prefix.
The return value should not be discarded.
| Name | Description |
|---|---|
| obj | The byte container to inspect. |
| prefix | The prefix bytes to compare against the start of obj. |