Monday, 27 July 2015

how to find number from string in vb.net

'add name space in vb.net code
Imports System.Text.RegularExpressions  

' Code for find number from string
 Dim x As String = "123a123&*^*&^*&^*&^   a sdsdfsdf"
        MsgBox(Integer.Parse(Regex.Replace(x, "[^\d]", "")))

No comments:

Post a Comment