util/StringAPI: add memrchr() wrapper

This commit is contained in:
Max Kellermann
2019-09-07 23:59:59 +02:00
parent 2c3eb5b8ad
commit 0b956cf968
3 changed files with 41 additions and 0 deletions

View File

@@ -94,6 +94,11 @@ struct BasicStringView : ConstBuffer<T> {
return StringFind(data, ch, this->size);
}
gcc_pure
pointer_type FindLast(value_type ch) const noexcept {
return StringFindLast(data, ch, size);
}
/**
* Split the string at the first occurrence of the given
* character. If the character is not found, then the first