0 votes
in JAVA by
How to remove special characters from a string in java?

1 Answer

0 votes
by

How to remove special characters from a string in java?

class New  

{  

public static void main(String args[])   

{  

String str= ""This#string%contains^special*characters&."";   

str = str.replaceAll(""[^a-zA-Z0-9]"", "" "");  

System.out.println(str);  

}  

}  

🔗Reference : stackoverflow.com

🔗Source: Java Interview Questions and Answers

🔗Reference: Javatpoint.com

Related questions

0 votes
asked Oct 12, 2020 in JAVA by Robindeniel
0 votes
asked Oct 24, 2020 in JAVA by sharadyadav1986
...