function test1(sur as string)as string
dim i as long
for i =1 to n step 2
test1=test1 & mid(sur,i,1)
next i
for i =len(n) to 2 step -2
test1=test1 & mid(sur,i,1)
next i
dim i as long
for i =1 to n step 2
test1=test1 & mid(sur,i,1)
next i
for i =len(n) to 2 step -2
test1=test1 & mid(sur,i,1)
next i
Private Sub Command1_Click()
Const str As String = "chinese"
Dim i As Integer
Dim S As String For i = 1 To Len(str)
If (i Mod 2) Then S = S & Mid(str, i, 1) '处理奇数字符
Next
For i = Len(str) To 1 Step -1
If (i Mod 2) = 0 Then S = S & Mid(str, i, 1) '处理偶数字符
Next
MsgBox S
End SubPrivate Sub Command2_Click()
'该程序适合象"abccdefg","abbcdefgh"
Const str As String = "excellent"
Dim i As Integer, j1 As Integer, j2 As Integer
Dim S As String, tempChar As String
For i = 1 To Len(str)
If i > 1 Then
If Mid(str, i, 1) = tempChar Then j1 = i - 1: j2 = i
End If
tempChar = Mid(str, i, 1)
Next
For i = j1 To 1 Step -1
S = S & Mid(str, i, 1)
Next
For i = j2 To Len(str)
S = S & Mid(str, i, 1)
Next
MsgBox S
End Sub