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,
how to achieve this?
 for(WebElement rowElement:TotalRowCount)
        {
              List<WebElement> TotalColumnCount=rowElement.findElements(By.xpath("td/span"));
              int ColumnIndex=1;
              for(WebElement colElement:TotalColumnCount)
              {
                  String s=colElement.getText().replace("%", "");
                  if(!s.isEmpty()&&!s.equals("NA"))
                  {
                   System.out.println("Row "+RowIndex+" Column "+ColumnIndex+" Data "+s);
                  }
                  else{/*do nothing*/}
               }
              RowIndex=RowIndex+1;
         }
 
     
     
     
     
     
    