A
A
Asikov Artur2018-09-09 13:22:43
JavaScript
Asikov Artur, 2018-09-09 13:22:43

How to remove dots, commas, spaces and % from a string?

I use this code to remove spaces from a string. Tell me how to expand it so that it removes
not only spaces, but also periods, commas, and the % symbol?
let str = str1.replace(/\s/g, '');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-09-09
@Artur937

str.replace(/[\s.,%]/g, '')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question