MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / TrimStringView

Function TrimStringView

src/util/string.h:162–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162[[nodiscard]] inline std::string_view TrimStringView(std::string_view str, std::string_view pattern = " \f\n\r\t\v")
163{
164 std::string::size_type front = str.find_first_not_of(pattern);
165 if (front == std::string::npos) {
166 return {};
167 }
168 std::string::size_type end = str.find_last_not_of(pattern);
169 return str.substr(front, end - front + 1);
170}
171
172[[nodiscard]] inline std::string TrimString(std::string_view str, std::string_view pattern = " \f\n\r\t\v")
173{

Callers 10

LoadBodyMethod · 0.85
TrimAndParseFunction · 0.85
RPCAuthorizedFunction · 0.85
ReadResponseMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85
addconnectionFunction · 0.85
GetConfigOptionsFunction · 0.85
LocaleIndependentAtoiFunction · 0.85
TrimStringFunction · 0.85

Calls

no outgoing calls

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68