| author | "Tomas Zeman <tzeman@volny.cz>" |
| Wed, 16 Jan 2008 22:39:43 +0100 | |
| changeset 0 | 6f7a81934006 |
| permissions | -rw-r--r-- |
| 0 | 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 |
} |