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

Function trim

LASzip/src/mydefs.cpp:691–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

SetWktMethod · 0.85
WktFormatMethod · 0.85

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected