Remove Hyphen from string in java

Rajashree Golasangi
Rajashree Golasangi used Ask the Experts™
on
I am having ssn number as "453-44-4534" and i want to remove hyphen and get string as "453444534".
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
Hi,

pls try
String s = "453-44-4534";
s = s.replace("-","");
System.out.println(s);

Open in new window

Regards
Top Expert 2016

Commented:
A solution

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial