码迷,mamicode.com
首页 > Windows程序 > 详细

c#, extract number from string

时间:2015-06-24 20:58:26      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:

using System.Text.RegularExpressions;

 

 

string numberStr = Regex.Match (str, "[0-9]").Value;

 

参考:

http://answers.unity3d.com/questions/19053/extract-number-from-string.html
ref: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.match(v=vs.110).aspx

 

c#, extract number from string

标签:

原文地址:http://www.cnblogs.com/wantnon/p/4598553.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!