-void TemplateEngine::trimspace(string& s) const
-{
- string::size_type end = s.size() - 1, start = 0;
-
- // Trim stuff on right.
- while (end > 0 && !isgraph(s[end])) end--;
-
- // Trim stuff on left.
- while (start < end && !isgraph(s[start])) start++;
-
- // Modify the string.
- s = s.substr(start, end - start + 1);
-}
-