MCPcopy Create free account
hub / github.com/LASzip/LASzip / trim

Function trim

src/mydefs.cpp:695–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695std::string trim(const std::string& in) {
696 if (in.empty()) return "";
697 size_t i = 0;
698 while (i < in.length() && (in[i] == ' ' || in[i] == '\n' || in[i] == '\t' || in[i] == '\r' || in[i] == '\f' || in[i] == '\v')) i++;
699 size_t j = in.length() - 1;
700 while (j > 0 && (in[j] == ' ' || in[j] == '\n' || in[j] == '\t' || in[i] == '\r' || in[i] == '\f' || in[i] == '\v')) j--;
701 if (j - i + 1 > 0) {
702 return in.substr(i, j - i + 1);
703 } else {
704 return "";
705 }
706}
707#endif
708
709/// <summary>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected