public static String canonicalID(String id){
  if (id == null)   return "";
  int st=0;
  int len=id.length();
  boolean substr=false;
  int c;
  while (st < len && ((c=id.charAt(st)) == '<' || c <= ' ')) {
    st++;
    substr=true;
  }
  while (st < len && ((c=id.charAt(len - 1)) == '>' || c <= ' ')) {
    len--;
    substr=true;
  }
  return substr ? id.substring(st,len) : id;
}

public static String canonicalID ( String id ) { if ( id == null ) return "" ; int st = 0 ; int len = id . length ( ) ; boolean substr = false ; int c ; while ( st < len && ( ( c = id . charAt ( st ) ) == '<' || c <= ' ' ) ) { st ++ ; substr = true ; } while ( st < len && ( ( c = id . charAt ( len - 1 ) ) == '>' || c <= ' ' ) ) { len -- ; substr = true ; } return substr ? id . substring ( st , len ) : id ; }
convert a message - id string to canonical form ( strips off leading and trailing & lt ; & gt ; s )
