implemented ExpandEnvironmentStringsForUserA/W
[reactos.git] / irc / ArchBlackmann / trim.cpp
1 // trim.cpp
2 // This file is (C) 2004 Royce Mitchell III
3 // and released under the BSD & LGPL licenses
4
5 #include "trim.h"
6
7 std::string trim ( const std::string& s )
8 {
9 const char* p = &s[0];
10 const char* p2 = p + s.size();
11 while ( *p == ' ' )
12 p++;
13 while ( p2 > p && p2[-1] == ' ' )
14 p2--;
15 return std::string ( p, p2-p );
16 }
17