Logo Search packages:      
Sourcecode: condor version File versions  Download package

void MyString::trim ( void   ) 

Trim leading and trailing whitespace from this string.

Definition at line 615 of file MyString.cpp.

References Length(), and Substr().

Referenced by CronTab::expandParameter().

{
      if( Len == 0 ) {
            return;
      }
      int         begin = 0;
      while ( isspace(Data[begin]) ) { ++begin; }

      int         end = Length() - 1;
      while ( isspace(Data[end]) ) { --end; }

      if ( begin != 0 || end != Length() - 1 ) {
            *this = Substr(begin, end);
      }
}


Generated by  Doxygen 1.6.0   Back to index