final String PrintVersion(String str){
  StringBuffer buf=new StringBuffer(str.length());
  for (int i=0; i < str.length(); i++) {
switch (str.charAt(i)) {
case '\"':
      buf.append("\\\"");
    break;
case '\\':
  buf.append("\\\\");
break;
case '\t':
buf.append("\\t");
break;
case '\n':
buf.append("\\n");
break;
case '\f':
buf.append("\\f");
break;
case '\r':
buf.append("\\r");
break;
default :
buf.append(str.charAt(i));
break;
}
}
;
return buf.toString();
}

final String PrintVersion ( String str ) { StringBuffer buf = new StringBuffer ( str . length ( ) ) ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { switch ( str . charAt ( i ) ) { case '\"' : buf . append ( "\\\"" ) ; break ; case '\\' : buf . append ( "\\\\" ) ; break ; case '\t' : buf . append ( "\\t" ) ; break ; case '\n' : buf . append ( "\\n" ) ; break ; case '\f' : buf . append ( "\\f" ) ; break ; case '\r' : buf . append ( "\\r" ) ; break ; default : buf . append ( str . charAt ( i ) ) ; break ; } } ; return buf . toString ( ) ; }
tostring ( ) modified 23 aug 2007 by ll to call printversion so strings with special characters are printed properly .
