adb was already using ConsumePrefix, and now we have another would-be
user in cutils. (There appears to be one place in adb that should use
ConsumeSuffix, so I'm assuming we'll want that sooner or later.)
I've kept these inline because adb and google3's versions both were, and
I'm easily led.
Test: treehugger
Change-Id: I29d99032f6f6ccbfaefece59725db8afb02a4c87
We should have done this from the beginning. Thanks to Windows, we're not
going to be able to switch libbase over to std::string_view any time soon.
Bug: N/A
Test: ran tests
Change-Id: Iff2f56986e39de53f3ac484415378af17dacf26b
ubsan doesn't like us incrementing std::string::npos, even if we won't use
the result.
Bug: http://b/28729303
Test: ran tests
Change-Id: I8227eca57dc6f3e49626c7025514caa04ef18f0a
This is more scalable than explicitly instantiating templates for the
cross product of containers and element types.
Specifically I'm adding this so I can join an unordered_set in adb.
Change-Id: I0055f3390a0ff26a886a0d41bbf0d4fe3d210f9c
Return a new vector rather than appending to the parameter.
Delimiters are also a string rather than a character. Split on any
character in the string.
Change-Id: I039b332ace5578590df9e7ca0e8fa3db28db30a3
These are useful outside of ART. Nothing changed (aside from fixing
Trim to not segfault on empty strings), so ART should be able to move
to using these.
Change-Id: Id026ebffe8d31f784a91834786ab189680b13a0f