我正在尝试删除除字母和空格以外的所有字符,但我无法这样做。我目前拥有的代码如下,我怎么能改变它,所以它确实允许空格?此刻它需要文本,剥离它,它就变成了一大行文本。
Dim InputTxt As String = InputText.Text
Dim OutputTxt As System.Text.StringBuilder = New System.Text.StringBuilder()
For Each Ch As Char In InputTxt
If (Not Char.IsLetter(Ch)) Then
OutputTxt.Append(Ch)
Continue For
End If
Dim CheckIndex As Integer = Asc("a") - (Char.IsUpper(Ch) * -32)
Dim Index As Integer = ((Asc(Ch) - CheckIndex) + 13) Mod 26
OutputTxt.Append(Chr(Index + CheckIndex))
Next
OutputText.Text = (OutputTxt.ToString())