vb 在字符串中插入字符
我想在字符串111111111111第三位,第六位,第九位,第十二插入字符2,成为1112111211121112.我用print语句输出结果成了111211121112...
我想在字符串111111111111第三位,第六位,第九位,第十二插入字符2,成为1112111211121112.我用print语句输出结果成了111 2 111 2 111 2 111 2 ,2和1之间有空格,怎么样写才能把空格去掉哩?谢谢各位达人啰~请写清楚点~我是菜鸟~
展开
展开全部
Private Sub Command1_Click()
Dim a As String
Dim c As String
Dim b(4) As String
Dim i As Integer
a = "111111111111"
Text1 = a
For i = 1 To Len(a) Step 3
b(i / 3) = Mid(a, i, 3) & "2"
Print b(i / 3);
Next
For i = 0 To 4 'Len(a) / 3
c = c & b(i)
Next
Text2 = c
End Sub
Dim a As String
Dim c As String
Dim b(4) As String
Dim i As Integer
a = "111111111111"
Text1 = a
For i = 1 To Len(a) Step 3
b(i / 3) = Mid(a, i, 3) & "2"
Print b(i / 3);
Next
For i = 0 To 4 'Len(a) / 3
c = c & b(i)
Next
Text2 = c
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Replace("111 2 111 2 111 2 111 2","1 2","12")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询