public Text trim(){
  int first=0;
  int last=length() - 1;
  while ((first <= last) && (charAt(first) <= ' ')) {
    first++;
  }
  while ((last >= first) && (charAt(last) <= ' ')) {
    last--;
  }
  return subtext(first,last + 1);
}

public Text trim ( ) { int first = 0 ; int last = length ( ) - 1 ; while ( ( first <= last ) && ( charAt ( first ) <= ' ' ) ) { first ++ ; } while ( ( last >= first ) && ( charAt ( last ) <= ' ' ) ) { last -- ; } return subtext ( first , last + 1 ) ; }
returns a copy of this text , with leading and trailing whitespace omitted .
