protected String getKey(String str) {
        int index = str.indexOf('=');
        String key = null;
        if (index > 0) {
            key = str.substring(0, index).trim();
            if (key.charAt(key.length() - 1) == ':') {
                key = key.substring(0, key.length() - 1).trim();
            }
        }
        return key;
    }
protected String getKey ( String str ) { int index = str . indexOf ( '=' ) ; String key = null ; if ( index > 0 ) { key = str . substring ( 0 , index ) . trim ( ) ; if ( key . charAt ( key . length ( ) - 1 ) == ':' ) { key = key . substring ( 0 , key . length ( ) - 1 ) . trim ( ) ; } } return key ; }
returns the key value of key = value, or key := value pair.