question: 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 ; }
target:  Convert a message-id string to canonical form (strips off leading and trailing &lt;&gt;s)