MCPcopy Create free account
hub / github.com/dds-bridge/dds / trimTrailing

Function trimTrailing

library/tests/parse.cpp:639–651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637
638
639string trimTrailing(
640 const string& text,
641 const char c)
642{
643 unsigned Pos = static_cast<unsigned>(text.length());
644 while (Pos >= 1 && text.at(Pos-1) == c)
645 Pos--;
646
647 if (Pos == 0)
648 return "";
649 else
650 return text.substr(0, Pos);
651}
652
653
654void splitIntoWords(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected