Contact: aviboots(AT)netvision.net.il
41,604 questions
54,252 answers
573 users
fun main() { val str = "What??? Why?? How?????" // Define regex pattern to match one or more '?' val pattern = Regex("\\?+") // Replace all matches with a single '?' val result = pattern.replace(str, "?") println(result) } /* run: What? Why? How? */