string 字符串中的空白字符用什么方法删去?????????????????????????????????
http://www.cnblogs.com/Shirlies/p/4666744.html
void trim(string &s)
2 {
3 /*
4 if( !s.empty() )
5 {
6 s.erase(0,s.find_first_not_of(" "));
7 s.erase(s.find_last_not_of(" ") + 1);
8 }
9 */
10 int index = 0;
11 if( !s.empty())
12 {
13 while( (index = s.find(' ',index)) != string::npos)
14 {
15 s.erase(index,1);
16 }
17 }
18
19 }