Foxtable(狐表)用户栏目专家坐堂 → 取相同符号分隔的值


  共有1801人关注过本帖树形打印复制链接

主题:取相同符号分隔的值

帅哥哟,离线,有人找我吗?
扶风
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:481 积分:3258 威望:0 精华:0 注册:2015/6/2 8:33:00
取相同符号分隔的值  发帖心情 Post By:2017/7/1 10:10:00 [显示全部帖子]

老师,如1*2*3*4*5*6*7这种类似的字符串,如何拆分*号分别取到1234567这7个数
如下现在靠的是取*号的位置,能否提供更简便的方法?

Dim g2 As String = Forms("比对").Controls("TextBox2").Value
Dim g3 As String = Mid(g2,1,Instr(g2,"*")-1)
Dim gn4 As String = Mid(g2,Instr(g2,"*")+1,Len(g2)-Len(g3))
Dim g4 As String = Mid(gn4,1,Instr(gn4,"*")-1)
Dim gn5 As String = Mid(gn4,Instr(gn4,"*")+1,Len(gn4)-Len(g4))
Dim g5 As String= Mid(gn5,1,Instr(gn5,"*")-1)
Dim gn6 As String = Mid(gn5,Instr(gn5,"*")+1,Len(gn5)-Len(g5))
Dim g6 As String = Mid(gn6,1,Instr(gn6,"*")-1)


 回到顶部