以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  提取特殊字符  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=119582)

--  作者:ZJZK2018
--  发布时间:2018/5/28 9:32:00
--  提取特殊字符
老师你好:
2018-001-sdf-edse-001
2018-015-drr-jjf-002
2017-021-jh-uu-005

如何提取第三个“-”后面的字符?谢谢

--  作者:有点甜
--  发布时间:2018/5/28 9:47:00
--  
Dim str As String = "2018-001-sdf-edse-001"
Dim ary() As String = str.split("-")
msgbox(ary(3))

--  作者:ZJZK2018
--  发布时间:2018/5/28 10:07:00
--  
我需要的是:第三个“-”后面所有字符如“edse-001”
--  作者:有点甜
--  发布时间:2018/5/28 10:28:00
--  
Dim str As String = "2018-001-sdf-edse-001"
Dim ary() As String = str.split("-")
Dim nstr As String = ""
For i As Integer = 3 To ary.length-1
    nstr &= ary(i) & "-"
Next
nstr = nstr.trim("-")
msgbox(nstr)