VB.NET取得字符串中所有的数字:
1.用正则表达式:
'引入命名空间
Imports System.Text.RegularExpressions
Public Shared Function GetNumbers(ByVal str As String) As String
Return Regex.Replace(str, “[a-z]”, “”, RegexOptions.IgnoreCase).Trim()
End Function
2.写一个vb.net教程函数
VB.NET取得字符串中所有的数字:
1.用正则表达式:
'引入命名空间
Imports System.Text.RegularExpressions
Public Shared Function GetNumbers(ByVal str As String) As String
Return Regex.Replace(str, “[a-z]”, “”, RegexOptions.IgnoreCase).Trim()
End Function
2.写一个vb.net教程函数