I have this string 123abc123 how can i get only integers from this string?
For example, convert 123abc123 to 123123.
What i tried:
Integer.Parse(abc)
You could use Char.IsDigit
Dim str = "123abc123"
Dim onlyDigits = New String(str.Where(Function(c) Char.IsDigit(c)).ToArray())
Dim num = Int32.Parse(onlyDigits)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With