summaryrefslogtreecommitdiff
path: root/lib/mystring/rstrip.cc
blob: b66f8ce9609f767c03265f3be97c6f97ef32865d (plain)
1
2
3
4
5
6
7
8
9
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);
}