MCPcopy Create free account
hub / github.com/boostorg/json / starts_with

Method starts_with

include/boost/json/string.hpp:1420–1424  ·  view source on GitHub ↗

Return whether the string begins with another string. @li **(1)** checks if the string begins with `s`. @li **(2)** checks if the string begins with `ch`. @par Complexity @li **(1)** linear in `s.size()`. @li **(2)** constant. @param s The string to check for. @{ */

Source from the content-addressed store, hash-verified

1418 @{
1419 */
1420 bool
1421 starts_with(string_view s) const noexcept
1422 {
1423 return subview(0, s.size()) == s;
1424 }
1425
1426 /** Overload
1427

Callers 1

testStartEndsWithMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected