diff options
Diffstat (limited to 'src/util/StringUtil.cxx')
-rw-r--r-- | src/util/StringUtil.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util/StringUtil.cxx b/src/util/StringUtil.cxx index 57fc5188b..dfe436fd8 100644 --- a/src/util/StringUtil.cxx +++ b/src/util/StringUtil.cxx @@ -33,6 +33,20 @@ strchug_fast(const char *p) return p; } +char * +Strip(char *p) +{ + p = strchug_fast(p); + + size_t length = strlen(p); + while (length > 0 && IsWhitespaceNotNull(p[length - 1])) + --length; + + p[length] = 0; + + return p; +} + bool StringStartsWith(const char *haystack, const char *needle) { |