MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / trim

Function trim

examples/parallel/parallel.cpp:19–32  ·  view source on GitHub ↗

trim whitespace from the beginning and end of a string

Source from the content-addressed store, hash-verified

17
18// trim whitespace from the beginning and end of a string
19static std::string trim(const std::string & str) {
20 size_t start = 0;
21 size_t end = str.size();
22
23 while (start < end && isspace(str[start])) {
24 start += 1;
25 }
26
27 while (end > start && isspace(str[end - 1])) {
28 end -= 1;
29 }
30
31 return str.substr(start, end - start);
32}
33
34static std::string k_system =
35R"(Transcript of a never ending dialog, where the User interacts with an Assistant.

Callers 1

mainFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected