Alex Gomes Alex Gomes - 2 months ago 15
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 ].