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
时间: 2024-10-01 03:19:07