关于VB 离分字符段问题 在线急等

来源:百度知道 编辑:UC知道 时间:2024/05/29 02:26:02
假设我 text1.text 里内容是 “我爱你”
我要怎么把“我”“爱”“你”分别提取到
text2.text text3.text text4.text 里
高手快来帮帮忙

Dim sp(3) As TextBox
Set sp(0) = Text2
Set sp(1) = Text3
Set sp(2) = Text4
p = Len(Text1.Text) - 1
For i = 0 To IIf(p <= 2, p, 2) '最大不能超过3个字
sp(i).Text = Mid(Text1.Text, i + 1, 1)
Next

sub()
text2.text=left$(text1.text,1)
text3.text=mid$(text1.text,2,1)
text4.text=right$(text1.text,1)
end sub

关于left$、right$、mid$几个函数的具体使用方法,自己搜索吧.