No "tryParseDouble" in Java?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1102891/how-to-check-a-string-is-a-numeric-type-in-java">How to check a String is a numeric type in java</a>  </p>
</blockquote>



<p>I see I can parse a <code>String</code> into a <code>double</code> by using <code>Double.parseDouble</code>. </p>

<p>Since that one might throw a <code>NumberFormatException</code>, <em>and</em> I don´t want to do programming by exception, I hesitate to put the <code>parseDouble</code> call into a <code>try</code>/<code>catch</code> block just to check if the string can be parsed into a <code>double</code>.</p>

<p>In Delphi, there is <code>TryParseInt</code> (I think), which returns a defined value (-1 I think) if the string cannot be parsed into an <code>Integer</code>.</p>

<p>There is nothing like that in Java?
I mean: there is no standard way to do this?</p>
