I am using the XSSFWorkbook for reading the excel sheet data. When i entered the numbers with space after 10 digits and want to remove the space after numbers before saving. But trim(),replaceAll() - all these are not removing the spaces. How can i remove the space from the string "99999999 " after fetching using currentCell.getStringCellValue().
tried with trim(),replaceAll() methods and also stringUtils.trim()
phoneNumber = currentCell.getStringCellValue().replaceAll(" ",""); System.out.println(phoneNumber);
Expected is : want to remove the space after the string "99999 " as "99999"
No error message but i am expecting "99999" but getting "99999 " after using all the mentioned methods.