using System;
using System.Text.RegularExpressions;
class ReplaceQuestionMarks {
static void Main() {
string str = "Hello??? How are you?? What is your Wi-Fi password????";
// Replace multiple '?' with a single '?'
string result = Regex.Replace(str, @"\?+", "?");
Console.WriteLine(result);
}
}
/*
run:
Hello? How are you? What is your Wi-Fi password?
*/