fork download
  1. public class RemoveSpecialCharacterExample1
  2. {
  3. public static void main(String args[])
  4. {
  5. String str= "This#string%contains^special*characters&.";
  6. str = str.replaceAll("[^a-zA-Z0-9]", " ");
  7. System.out.println(str);
  8. }
  9. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class RemoveSpecialCharacterExample1 is public, should be declared in a file named RemoveSpecialCharacterExample1.java
public class RemoveSpecialCharacterExample1
       ^
1 error
stdout
Standard output is empty