Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (10.2k points)

I tried using this but didn't work-

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

1 Answer

0 votes
by (46k points)

Use [^A-Za-z0-9].

Note: removed the space since that is not typically considered alphanumeric.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...