Rune Caster 1.0.0
Modern C++ Text Processing Framework
Loading...
Searching...
No Matches
trim_edges.cpp
Go to the documentation of this file.
2
3namespace rune_caster {
4namespace spell {
5namespace core {
6
8 if (input.empty()) return RuneSequence();
9 auto start = 0u;
10 auto end = input.size();
11 while (start < end && input[start].is_whitespace()) ++start;
12 while (end > start && input[end - 1].is_whitespace()) --end;
13 return input.substr(start, end - start);
14}
15
16} // namespace core
17} // namespace spell
18} // namespace rune_caster
bool empty() const noexcept
size_type size() const noexcept
RuneString substr(size_type start, size_type length=npos) const
Create a substring.
RuneSequence operator()(const RuneSequence &input) const override
Apply the spell transformation.
Definition trim_edges.cpp:7
RuneString RuneSequence
Backward compatibility alias for RuneString.