【发布时间】:2011-01-19 10:24:53
【问题描述】:
我需要查找并提取字符串中包含的数字。
例如,从这些字符串中:
string test = "1 test"
string test1 = " 1 test"
string test2 = "test 99"
我该怎么做?
【问题讨论】:
-
这个数字可能是负数吗?如果是这样,“你好-你好吗?-30”如何处理?
-
嗨约翰,数据中没有负数
-
像
1.5这样的小数?像1.5E45这样的指数符号? -
为什么这里不接受答案?