MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / TrimString

Function TrimString

vkconfig_core/util.cpp:130–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130std::string TrimString(const std::string& str, const std::string& whitespaces) {
131 const auto strBegin = str.find_first_not_of(whitespaces);
132 if (strBegin == std::string::npos) return ""; // no content
133
134 const auto strEnd = str.find_last_not_of(whitespaces);
135 const auto strRange = strEnd - strBegin + 1;
136
137 return str.substr(strBegin, strRange);
138}
139
140std::string TrimSurroundingWhitespace(const std::string& str, const std::string& whitespaces) {
141 std::string s = str;

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68