How to check if a string is a positive number, negative number or not a number
<h2>Problem</h2>
<p>I have a <code>String</code> and I want to know if the <code>String</code> is a number, it could be also a negative number</p>
<h2>Test cases</h2>
<pre><code>String test1  = &quot;abcd&quot;;     // Here it must show that it's not a number
String test2  = &quot;abcd-123&quot;; // Here it must show that it's not a number
String test3  = &quot;123&quot;;      // Here it must show that it's a number
String test4  = &quot;-.12&quot;;     // Here it must show that it's a number
String test5  = &quot;-123&quot;;     // Here it must show that it's a number
String test6  = &quot;123.0;     // Here it must show that it's a number
String test7  = &quot;-123.00&quot;;  // Here it must show that it's a number
String test8  = &quot;-123.15&quot;;  // Here it must show that it's a number
String test9  = &quot;09&quot;;       // Here it must show that it's a number
String test10 = &quot;0.0&quot;;      // Here it must show that it's a number
</code></pre>
<h2>Tried stuff</h2>
<p>I used <code>StringUtils#isNumber</code> and <code>NumberUtils#isNumber</code>, but they don't help, <em>negative numbers</em>, &quot;09&quot; show as not a number</p>