
vb中输入一串字符串,字符串中每个字符字典顺序递增1如何实现。如输入abc,输出bcd
3个回答
展开全部
Private Sub Command1_Click()
dim a,b as string
a=inputbox("输入字符串")
For i = 1 To Len(a)
b=b & chr(asc(mid(a,i,1))+1)
next
msgbox b
next
dim a,b as string
a=inputbox("输入字符串")
For i = 1 To Len(a)
b=b & chr(asc(mid(a,i,1))+1)
next
msgbox b
next
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在窗体上添加一个文本框
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii > 64 And KeyAscii < 90 Or KeyAscii > 96 And KeyAscii < 122 Then
KeyAscii = KeyAscii + 1
ElseIf KeyAscii = 90 Or KeyAscii = 122 Then KeyAscii = KeyAscii - 25
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii > 64 And KeyAscii < 90 Or KeyAscii > 96 And KeyAscii < 122 Then
KeyAscii = KeyAscii + 1
ElseIf KeyAscii = 90 Or KeyAscii = 122 Then KeyAscii = KeyAscii - 25
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Option Explicit
Dim s, s1 As String
Dim i As Integer
Private Sub Command1_Click()
s = Text1.Text
Text1.Text = ""
For i = 1 To Len(s)
s1 = Mid(s, i, 1)
If Asc(s1) <= Asc("z") And Asc(s1) >= Asc("a") Then
s1 = Chr(Asc(s1) + 1)
Text1.Text = Text1.Text + s1
End If
Next i
End Sub
Dim s, s1 As String
Dim i As Integer
Private Sub Command1_Click()
s = Text1.Text
Text1.Text = ""
For i = 1 To Len(s)
s1 = Mid(s, i, 1)
If Asc(s1) <= Asc("z") And Asc(s1) >= Asc("a") Then
s1 = Chr(Asc(s1) + 1)
Text1.Text = Text1.Text + s1
End If
Next i
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询