标题: 怎样将ABCDEFG转成A-B-C-D-E-F-G? [打印本页] 作者: xinle 时间: 2006-4-11 22:47 标题: 怎样将ABCDEFG转成A-B-C-D-E-F-G? 如果有些一字符,比如:ABCDEFG
能不能用一逐步形成句子将其变成:A-B-C-D-E-F-G
谢谢! 作者: xinle 时间: 2006-4-11 22:57
Dim i, n As Integer
n = Len("ABCDEF")
For i = 1 To n
Sn1 = Sn1 & "-" & Asc(Mid("ABCDEF", i, 1))
Next
Dim i, n As Integer
n = Len("ABCDEF")
For i = 1 To n
Sn1 = Sn1 & "-" & Asc(Mid("ABCDEF", i, 1))
Next
sn1=mid(sn1,2,len(trim(sn1)))作者: qhp-soft 时间: 2006-4-11 23:36
Dim a, b, j As String
j = "ABCDEFG"
For i = 1 To Len(j)
a = Mid(j, i, 1)
If i = Len(j) Then
b = b + a
Else
b = b + a + "-"
End If
Next
MsgBox b