| changeset 0 | 6f7a81934006 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/mystring/rstrip.cc Wed Jan 16 22:39:43 2008 +0100 @@ -0,0 +1,10 @@ +#include "mystring.h" +#include <ctype.h> + +mystring mystring::rstrip() const +{ + const char* ptr = rep->buf + rep->length - 1; + while(ptr >= rep->buf && isspace(*ptr)) + --ptr; + return mystring(rep->buf, ptr-rep->buf+1); +}