SHOW:
|
|
- or go back to the newest paste.
| 1 | public static String fileSafeString(String s) {
| |
| 2 | char[] a = { '/', '\n', '\r', '\t', '\0', '\f', '`', '?', '*', '\\', '<', '>', '|', '"', ':' };
| |
| 3 | int i = a.length; | |
| 4 | for (int x = 0; x < i; x++) {
| |
| 5 | char c = a[i]; | |
| 6 | - | s.replace(c, '_'); |
| 6 | + | s = s.replace(c, '_'); |
| 7 | } | |
| 8 | return s; | |
| 9 | } |