src/Matrix/row_vector.cc
/**
 * squeeze - remove @line's excess separation characters and leading whitespace
 * @line: the string to be processed
 * Description: squeeze() returns a copy of @line with exactly one space
 * character (` ') between words. Excess space characters and tabs (`\t')
 * are removed in the returned copy. squeeze() also removes leading
 * whitespace from @line.
 */
remove @line's excess separation characters and leading whitespace
@line: the string to be processed
Description: squeeze() returns a copy of @line with exactly one space
character (` ') between words. Excess space characters and tabs (`\t')
are removed in the returned copy. squeeze() also removes leading
whitespace from @line.
remove @line ' s excess separation characters and leading whitespace @line : the string to be processed Description : squeeze () returns a copy of @line with exactly one space character ( ` ' ) between words . Excess space characters and tabs ( ` \ t ' ) are removed in the returned copy . squeeze () also removes leading whitespace from @line .
string row_vector::squeeze (string line)
{
  int nwhite = 0;
  string squeezed, whchars = " \t";
  if (!line.length())
    return "";
  int pos = line.find_first_not_of (whchars);
  for (unsigned int i = pos; i < line.length(); i++) {
    if (isws (line[i]) && nwhite < 1) {    
	  squeezed += " ";
	  nwhite++;
	}
	else if ((isws (line[i])) && nwhite >= 1) {
	  nwhite++;
	}
	else {
	  squeezed += line[i];
	  nwhite = 0;
	}
  }
  return squeezed;
}
string row_vector :: squeeze ( string line ) { int nwhite = 0 ; string squeezed , whchars = " \t " ; if ( ! line . length ( ) ) return " " ; int pos = line . find_first_not_of ( whchars ) ; for ( unsigned int i = pos ; i < line . length ( ) ; i ++ ) { if ( isws ( line [ i ] ) && nwhite < 1 ) { squeezed += " " ; nwhite ++ ; } else if ( ( isws ( line [ i ] ) ) & & nwhite >= 1 ) { nwhite ++ ; } else { squeezed += line [ i ] ; nwhite = 0 ; } } return squeezed ; }
squeeze - remove @line's excess separation characters and leading whitespace
 @line: the string to be processed
 Description: squeeze() returns a copy of @line with exactly one space
 character (` ') between words.
squeeze - remove @line ' s excess separation characters and leading whitespace @line : the string to be processed Description : squeeze () returns a copy of @line with exactly one space character ( ` ' ) between words .
/* Keep one whitespace char.  */