Sub TextField1_TextChanged (Old As String, New As String)
Dim i As Int = TextField1.SelectionStart
'TextField1.Text = Regex.Replace("~(.)", New, "$1") 'replace all tildes that are not the last character.
TextField1.Text = Regex.Replace("~(.)", TextField1.Text, "$1") 'replace all tildes that are not the last character.
'TextField1.Text = TextField1.Text.Replace("~ã","ã") ' works too
TextField1.SetSelection(i,i)
End Sub