| changeset 0 | 6f7a81934006 |
| -1:000000000000 | 0:6f7a81934006 |
|---|---|
1 #include "mystring.h" |
|
2 #include <ctype.h> |
|
3 |
|
4 mystring mystring::strip() const |
|
5 { |
|
6 const char* start = rep->buf; |
|
7 while(*start && isspace(*start)) |
|
8 ++start; |
|
9 const char* end = rep->buf + rep->length - 1; |
|
10 while(end >= start && isspace(*end)) |
|
11 --end; |
|
12 return mystring(start, end-start+1); |
|
13 } |