C
C
chelovek_rediska2018-05-15 18:38:28
Java
chelovek_rediska, 2018-05-15 18:38:28

How to remove all special characters from a string?

For example, there is a string " \n\t\rText\t\n ".
How to remove all special characters and leave only the word Text ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-05-15
@0xD34F

str.replaceAll("[^\\w ]", "")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question