I am trying to parse a string to Integer. Im reading this string from a excel File.
String nos=new String((sheet.getCell(1, i).getContents().replace(" NOS", ""))).trim().replaceAll("^ *", "");
int stock=Integer.parseInt(nos);
Here is the Errorjava.lang.NumberFormatException: For input string: """827"""
You could use a regular expression like
"\"*(\\d+)\"*.*"
which will optionally match quotes around digits and anything following. By using the parenthesis we are grouping the digits and then we can get that group out likeOutput is