String contains a number?

Hey, How to check if a String contains a number?

1 Like

Hi @UiMe,

you can check with regex as the following,

Regex.Match(yourInputString, “\d+(?:[.,]\d+)*”)


You can find using the below condition.
it gives true if it contains any number otherwise false.
“Your String”.Any( function(x) char.IsDigit(x))

if you want to know what is the number in your string try the below condition.

String.Join(vblf,(From item In “Your String”.ToString
Where IsNumeric(item)
Select item))

1 Like

Hi @sarathi125,