MCPcopy Create free account
hub / github.com/ElementsProject/elements / TrimString

Function TrimString

src/util/string.h:19–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#include <vector>
18
19[[nodiscard]] inline std::string TrimString(const std::string& str, const std::string& pattern = " \f\n\r\t\v")
20{
21 std::string::size_type front = str.find_first_not_of(pattern);
22 if (front == std::string::npos) {
23 return std::string();
24 }
25 std::string::size_type end = str.find_last_not_of(pattern);
26 return str.substr(front, end - front + 1);
27}
28
29[[nodiscard]] inline std::string RemovePrefix(const std::string& str, const std::string& prefix)
30{

Callers 12

TrimAndParseFunction · 0.85
readStdinFunction · 0.85
RPCAuthorizedFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
BOOST_FIXTURE_TEST_CASEFunction · 0.85
FUZZ_TARGET_INITFunction · 0.85
FUZZ_TARGETFunction · 0.85
ToStringMethod · 0.85
addconnectionFunction · 0.85
LocaleIndependentAtoiFunction · 0.85
ParseMoneyFunction · 0.85
GetConfigOptionsFunction · 0.85

Calls

no outgoing calls

Tested by 4

BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_FIXTURE_TEST_CASEFunction · 0.68
FUZZ_TARGET_INITFunction · 0.68
FUZZ_TARGETFunction · 0.68