code: public static boolean isDouble(String string) {
      if (string == null) {
        return false;
      }
  
      try {
        Double.parseDouble(string);
      } catch (NumberFormatException e) {
        return false;
      }
  
      return true;
    }
docs: Checks whether given string has a double value.
  
  @param string the string to check
  @return true if string resembles a double value, false otherwise