字符串用几种符号一起做分割符
比如说:有这样一个字符串:”ndjk,dsh jdks?bhsj 123,abc”
要分成4个数组元素 而不是2个
比如说:有这样一个字符串:”ndjk,dsh jdks?bhsj 123,abc”
要分成4个数组元素 而不是2个
解决方案 »
- 测试
- 如果 su112.EXE关闭,马上让它重新启动,怎么做啊?
- vb学的不知道样
- combox 无法 使用退格和移动建?(在线等)
- 如何实现类似资源管理器左侧浏览窗口上面标题为文件夹的Toolbar1控件右侧关闭按钮的效果
- 如何监视一个SQL表的动作
- vb连接各类数据库的方法
- 盼!如何将Access一个表的内容复制到另个表中?
- 程序标题栏的文字显示
- 各位大虾,求求你们,帮帮忙,(给分,交朋友,谢谢!!!)
- 输入一个字符串(日期),把它从24小时变成上午下午12小时显示,并把某些小于10月或10日的去掉"0",比如2007-03-08-15-27-40, 怎么让它变成20
- 请问关于下拉菜单与文本框同步显示的问题
dim nLoop as interger
dim lastpos as intergerdim output(3) as string
dim nowoutput as intergermystr="ndjk,dsh jdks?bhsj 123,abc"
lastpos=1
for nloop=1 to len(mystr)if mid(mystr,nloop,1)="," or mid(mystr,nloop,1)="?" thenoutput(nowoutput)=mid(mystr,lastpos,nloop-lastpos)
lastpos=nloop+1
nowoutput=nowoutput + 1end ifnext nloopoutput(3)=mid(mystr,lastpos,len(mystr)-lastpos)
Dim mystr As String
Dim nLoop As Integer
Dim lastpos As Integer
Dim output(3) As String
Dim nowoutput As Integermystr = "ndjk,dsh jdks?bhsj 123,abc"
lastpos = 1
For nLoop = 1 To Len(mystr)
If Mid(mystr, nLoop, 1) = "," Or Mid(mystr, nLoop, 1) = "?" Then
output(nowoutput) = Mid(mystr, lastpos, nLoop - lastpos)
lastpos = nLoop + 1
nowoutput = nowoutput + 1
End If
Next nLoop
output(3) = Mid(mystr, lastpos, Len(mystr) - lastpos + 1)
s=replace(s, "?", ",")
s=replace(s, "/", ",")
s=replace(s, "\", ",")
s=replace(s, ";", ",")
s=replace(s, "|", ",")'若干种都可以,添加转换就是。dim arr() as string
arr=split(s, ",")
————————————————————————————————————
现在的人们要求越来越高!事情还是十画还没有一撇,就要源码!