I want to remove special characters from a String which is passed by a jsp file
I am receiving the value 2019/05/09
and I want to remove all the "/".
Expected output - 20190509
How can I do this? Thanks for the time!
I want to remove special characters from a String which is passed by a jsp file
I am receiving the value 2019/05/09
and I want to remove all the "/".
Expected output - 20190509
How can I do this? Thanks for the time!
You need to remove the '/' and then do the parsing.
int checkin = Integer.parseInt(request.getParameter("checkin").replace("/",""));
Hi i assume that the datatype that you get in the request parameter is String.
You may use this.
int checkin = Integer.valueOf(request.getParameter("checkin").replace("/",""));