fork download
  1.  
  2. class HelloWorld {
  3. public static void main(String[] args) {
  4. String stringArray[] = new String[]{"a\"b#$c/", "d234e=>?f"};
  5. String charsToBeReplaced = "[!\"#$%&'()*+,-.\\/0123456789:;<=>?@]"; //your ASCII 33 to 64 characters... notice that only forward slash is escaped here
  6.  
  7. for (int i=0; i<stringArray.length; i++){
  8. stringArray[i] = stringArray[i].replaceAll(charsToBeReplaced, "");
  9. System.out.println(stringArray[i]);
  10. }
  11. }
  12. }
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
abc
def