Contact: aviboots(AT)netvision.net.il
41,336 questions
53,852 answers
573 users
const str = "What??? Why?? How?????"; // Use regular expression to match one or more '?' const result = str.replace(/\?+/g, "?"); console.log(result); /* run: What? Why? How? */