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

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