Contact: aviboots(AT)netvision.net.il
40,758 questions
53,129 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? */