title: How to parse String having decimal, negative decimal into integer?
body: <p>Under for loop i am getting string values like  decimal,integer, negative decimal values, i want to convert all of them in integer with one if condition,</p>
  
  <p>how to achieve this?</p>
  
  <pre><code> for(WebElement rowElement:TotalRowCount)
          {
                List&lt;WebElement&gt; TotalColumnCount=rowElement.findElements(By.xpath("td/span"));
                int ColumnIndex=1;
                for(WebElement colElement:TotalColumnCount)
                {
                    String s=colElement.getText().replace("%", "");
  
                    if(!s.isEmpty()&amp;&amp;!s.equals("NA"))
                    {
  
                     System.out.println("Row "+RowIndex+" Column "+ColumnIndex+" Data "+s);
  
                    }
                    else{/*do nothing*/}
                 }
                RowIndex=RowIndex+1;
           }
  </code></pre>