public Map<String,String> parse(final String str,char[] separators){
  if (separators == null || separators.length == 0) {
    return new HashMap<String,String>();
  }
  char separator=separators[0];
  if (str != null) {
    int idx=str.length();
    for (    char separator2 : separators) {
      int tmp=str.indexOf(separator2);
      if (tmp != -1 && tmp < idx) {
        idx=tmp;
        separator=separator2;
      }
    }
  }
  return parse(str,separator);
}

public Map < String , String > parse ( final String str , char [ ] separators ) { if ( separators == null || separators . length == 0 ) { return new HashMap < String , String > ( ) ; } char separator = separators [ 0 ] ; if ( str != null ) { int idx = str . length ( ) ; for ( char separator2 : separators ) { int tmp = str . indexOf ( separator2 ) ; if ( tmp != - 1 && tmp < idx ) { idx = tmp ; separator = separator2 ; } } } return parse ( str , separator ) ; }
extracts a map of name / value pairs from the given string . names are expected to be unique . multiple separators may be specified and the earliest found in the input string is used .
