c#, extract number from string

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

 

posted on 2015-06-24 20:14  wantnon  阅读(363)  评论(0编辑  收藏  举报

导航