以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  字符窜中提取数字  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=96800)

--  作者:一笑
--  发布时间:2017/2/28 9:51:00
--  字符窜中提取数字
例如字符串“3 月 14 日-16 日”,如何剔除中文字符,尝试以下代码,不行,求解,谢谢!
Dim st As String = "3 月 14 日-16 日"
Dim st1 As String = st.replace("[^0-9\\.a-zA-Z]", "")
output.show(st1)

--  作者:有点色
--  发布时间:2017/2/28 10:09:00
--  
Dim st As String = "3 月 14 日-16 日"
Dim st1 As String = System.Text.RegularExpressions.Regex.replace(st, "[^0-9\\.a-zA-Z]", " ")
st1 = System.Text.RegularExpressions.Regex.replace(st1, " +", " ")
output.show(st1)