repo.or.cz
/
xcsoar.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
android/GlueIOIOPort: fix spurious errors after IOIO baud rate change
[xcsoar.git]
/
src
/
Util
/
tstring.cpp
blob
393a20d702238c5c39d17bdf62b34a6d81867ecd
1
#include
"tstring.hpp"
2
3
#include <tchar.h>
4
5
#define WHITESPACE _T(
"
\r\t
"
)
6
7
tstring
&
8
trim_inplace
(
tstring
&
s
)
9
{
10
tstring
::
size_type n
;
11
12
n
=
s
.
find_first_not_of
(
WHITESPACE
);
13
if
(
n
!=
tstring
::
npos
)
14
s
.
erase
(
0
,
n
);
15
16
n
=
s
.
find_last_not_of
(
WHITESPACE
);
17
if
(
n
!=
tstring
::
npos
)
18
s
.
erase
(
n
+
1
,
s
.
length
());
19
20
return
s
;
21
}