ASP VB JAVA 网页设计中怎么 可以来取得字符串中的数字

来源:百度知道 编辑:UC知道 时间:2024/05/29 19:02:30
比如我的数据是 rs(2)
去掉空格是 TRIM(RS(2))

可是 如果 RS(2) = 2008-8-7 或者 2000元/月

如何从中间取得 2008 8 7 或者 2000 这些数字啊

知道的朋友请指教
如果没有正确答案我会选第一个回答的人
答对另送分

如果只是像2008-8-7这种规则的日期的话,取数字是比较简单的.用Replace就可以了.
str = "2008-8-7"
result = Split(str,"-")
for i = 0 to Ubound(result)
response.write result(i)
response.write " "
next

如果是像2000元/月这种的话也很简单

str = "2000元/月"
result = replace(str,"元/月","")
response.write result