title: How to get float value from string
body: <p>I have a string like</p>
  
  <pre><code>&gt; 12.4N-m/kg.
  </code></pre>
  
  <p>From the above string I need to get a value <code>12.4</code>.</p>
  
  <p>When I use replace all function <code>str.replaceAll("[^.0-9]", "")</code>.</p>
  
  <p>This doesn't work when then string has two dots.</p>
  
  <p>The location of float value may differ.</p>