title: How to check if a string is numeric/float in Typescript?
body: <p>Here are the validations which I want to apply:</p>
  
  <ol>
  <li>The string should contain any character between 0 to 9.</li>
  <li>It should not contain any alphabetical character.</li>
  <li>It can contain at most one '-' (minus operator) which will signify a negative number such as "-12".</li>
  <li>It can also contain at most one '.' to cover the case of floating numbers such as "12.2"</li>
  </ol>
  
  <p>Now I have tried various combinations but still I am unsuccessful to create such a condition in Typescript.
  Here's what I tried:</p>
  
  <ul>
  <li><strong>using regex</strong> /^[0-9.{0,1}-{0,1}]/.test(mystring)</li>
  </ul>
  
  <p>Unfortunately, this didn't work for me.
  Can anyone please help me to get the desired solution? </p>