public static String extractParameter(String input,String param,String defaultValue){
  int begin=input.indexOf(param) + param.length();
  if (begin != -1) {
    int end=input.indexOf(" ",begin);
    if (input.charAt(begin) == '\"') {
      begin++;
      end=input.indexOf("\"",begin);
    }
    if (end == -1) {
      return input.substring(begin);
    }
    return input.substring(begin,end);
  }
  return defaultValue;
}

public static String extractParameter ( String input , String param , String defaultValue ) { int begin = input . indexOf ( param ) + param . length ( ) ; if ( begin != - 1 ) { int end = input . indexOf ( " " , begin ) ; if ( input . charAt ( begin ) == '\"' ) { begin ++ ; end = input . indexOf ( "\"" , begin ) ; } if ( end == - 1 ) { return input . substring ( begin ) ; } return input . substring ( begin , end ) ; } return defaultValue ; }
extract a parameter from an input text
