麻烦高手们来填下空!
题目:译电文。为使电文保密,常按一定规律将其转换成密码,比如按照以下规律:将字母A变成E,即变成其后的第四个字母,相应的最后四个字母W变成A,X变成B,Y变成C,Z变成D,小写字母也一样。现在代码如下,麻烦把当字母是最后4个时的代码填下,谢谢大家了!Private Sub Command1_Click()
Dim string1, string2, c As String
string1 = Text1.Text
strl = Len(string1)
For i = 1 To strl
c = Mid(string1, i, 1)
If (c >= "a" And c <= "z") Or (c >= "A" And c <= "Z") Then
c = Chr(Asc(c) + 4)
If Then
'当字母是最后4个时
c =
End If
End If
string2 = string2 & c
Next
Text2.Text = string2
End Sub
代码如上,当字母是最后4个时,If后要怎么写,c=多少呢?大家帮个忙!