diff options
Diffstat (limited to 'src/util/StringUtil.cxx')
-rw-r--r-- | src/util/StringUtil.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/util/StringUtil.cxx b/src/util/StringUtil.cxx index 49a311a5f..bcade2b3b 100644 --- a/src/util/StringUtil.cxx +++ b/src/util/StringUtil.cxx @@ -35,6 +35,24 @@ StripLeft(const char *p) return p; } +const char * +StripLeft(const char *p, const char *end) +{ + while (p < end && IsWhitespaceOrNull(*p)) + ++p; + + return p; +} + +const char * +StripRight(const char *p, const char *end) +{ + while (end > p && IsWhitespaceOrNull(end[-1])) + --end; + + return end; +} + size_t StripRight(const char *p, size_t length) { |