发布网友 发布时间:2022-04-23 09:34
共2个回答
热心网友 时间:2023-09-01 01:35
用split函数取出每个数,判断长度,不满足的用format函数来强制格式:
Private Sub Form_Load()
Text1 = "21 25 1 2 3 4 31 5 9 32 33"
End Sub
Private Sub Command1_Click()
Dim a() As String
a() = Split(Text1, " ", -1, vbTextCompare)
Text1 = ""
For i = 0 To UBound(a())
If Len(a(i)) = 1 Then
a(i) = Format(a(i), "00")
End If
Text1 = Text1 & a(i) & " "
Next i
End Sub
热心网友 时间:2023-09-01 01:35
right("0"&text1,2)