Alex Gomes Alex Gomes - 4 months ago 42
Java Question

Replacing all non-alphanumeric characters with empty strings

I tried using this but didn't work-

return value.replaceAll("/[^A-Za-z0-9 ]/", "");

Answer

Why did you put those /? Just use [^A-Za-z0-9 ].