Alex Gomes Alex Gomes - 1 year ago 136
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download