title: How to Remove the Decimal Point in string using regex?
body: <p>I want to format a string as a removing decimal and keep only integers , but the decimal contains some following zeros after the decimal. How do I format it such that those 0's disappear?</p>
  
  <p>I have Input string data : </p>
  
  <pre><code>var xRaw= ",String30.0,String1.0,String0.0,String-1.0,StringOFF".Split(',').ToList();
  </code></pre>
  
  <p>How to get out put format :   <code>"30,1,0,-1,OFF"</code> </p>
  
  <pre><code>var ValuesString = xRaw.Select(x =&gt; Regex.Replace(x, "[^OF0-9-,\\.]", "")).ToList()
      .Where(s =&gt; !string.IsNullOrWhiteSpace(s)).ToList();
  </code></pre>
  
  <p>Above regex will remove the string and keep required string "OFF" but its keeps another which is next to "." point.</p>