public static String removeQuotationMarksIfNeeded(String str){
  if (str.startsWith("\"") && str.endsWith("\""))   return str.substring(1,str.length() - 1);
  return str;
}

public static String removeQuotationMarksIfNeeded ( String str ) { if ( str . startsWith ( "\"" ) && str . endsWith ( "\"" ) ) return str . substring ( 1 , str . length ( ) - 1 ) ; return str ; }
remove quotation marks at the beginning and end of the string if present .
