Dim i As Long, j As Long
Dim astr As String
Dim stmp As String
i = 230001
astr = CStr(i)
i = Len(astr)
For j = 1 To i
stmp = stmp & Mid(astr, j, 1) & " "
Next
stmp = Left(stmp, Len(stmp) - 1)
Dim astr As String
Dim stmp As String
i = 230001
astr = CStr(i)
i = Len(astr)
For j = 1 To i
stmp = stmp & Mid(astr, j, 1) & " "
Next
stmp = Left(stmp, Len(stmp) - 1)
B = ""
For i = 1 To Len(a)
B = B + Mid(a, i, 1) + " "
Next i
Debug.Print B
dim Num as long
num = 230001
dim str,str2 as string
str = cstr(num)
for i = 1 to len(str)
str2 = mid(str,i,1) + " "
next i
Dim strInput As String
Dim strOutput As String
Dim lngPosition As Long
strInput = "230001"
'在邮编字串里取出每一个数字并加上一个空格
'注意,完成时是" 2<空格>3<空格>0<空格>0<空格>0<空格>1<空格>
'最后一个空格是多余的,要去掉它
For lngPosition = 1 To Len(strInput)
strOutput = strOutput & Mid(strInput, lngPosition, 1) & " "
Next
'去掉最后一个多余的空格
strOutput = Trim(strOutput)
MsgBox strOutput
End Sub
而且我声明变量:Dim youbian as String
youbian = rs("item25") '是从数据库中提取的邮编,
Text1.Text = youbian
现在要把邮编打印出来,而且是其有空格的话,该如何? 谢谢了!
Dim astr As String
Dim stmp As String astr = youbian
i = Len(astr)
For j = 1 To i
stmp = stmp & Mid(astr, j, 1) & " "
Next
Text1.Text= Left(stmp, Len(stmp) - 1) 给分吧!
特别感谢: uguess(uguess)给分了