Imports System
Imports System.Text.RegularExpressions
Class ReplaceQuestionMarks
Public Shared Sub Main()
Dim str As String = "Hello??? How are you?? What is your Wi-Fi password????"
Dim result As String = Regex.Replace(str, "\?+", "?")
Console.WriteLine(result)
End Sub
End Class
' run:
'
' Hello? How are you? What is your Wi-Fi password?
'