MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / capitalize

Method capitalize

subprojects/llama.cpp/common/jinja/string.cpp:137–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135 });
136}
137string string::capitalize() {
138 return apply_transform(*this, [](const std::string & s) {
139 if (s.empty()) return s;
140 std::string res = s;
141 res[0] = ::toupper(static_cast<unsigned char>(res[0]));
142 std::transform(res.begin() + 1, res.end(), res.begin() + 1, ::tolower);
143 return res;
144 });
145}
146string string::titlecase() {
147 return apply_transform(*this, [](const std::string & s) {
148 std::string res = s;

Callers 1

value.cppFile · 0.80

Calls 4

apply_transformFunction · 0.85
emptyMethod · 0.65
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected