Changeset 5910 in ntrip for trunk/BNC/src/bncutils.cpp


Ignore:
Timestamp:
Aug 12, 2014, 3:23:19 PM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncutils.cpp

    r5888 r5910  
    6969  }
    7070
     71}
     72
     73// Strip White Space
     74////////////////////////////////////////////////////////////////////////////
     75void stripWhiteSpace(string& str) {
     76  if (!str.empty()) {
     77    string::size_type beg = str.find_first_not_of(" \t\f\n\r\v");
     78    string::size_type end = str.find_last_not_of(" \t\f\n\r\v");
     79    if (beg > str.max_size())
     80      str.erase();
     81    else
     82      str = str.substr(beg, end-beg+1);
     83  }
    7184}
    7285
Note: See TracChangeset for help on using the changeset viewer.