How to check if a string contains only digits?

String1 = ds9239 -> False
String 2 = 4343 -> True

Thanks.

Hi @EngAnalyst This post will resolve your query.

HI @EngAnalyst

You can just use a regex expression like

System.Text.RegularExpressions.Regex.IsMatch(YourString,"[0-9]")
this will give your vales in true or false that the string contains digits or not

Cheers

1 Like