Hi,
I have such strings : A120, 1020, XD39 etc. I need only these with numbers. How to do this? With Regex?
Hi,
I have such strings : A120, 1020, XD39 etc. I need only these with numbers. How to do this? With Regex?
Do u mean u need to check whether any string contains letter then use this
Yes I mean this
use this
Regex.Match(yourInputString, “\d+(?:[.,]\d+)*”)
hope it will work
Try this
[A-Z]+[0-9]+ @Marek_Matuszak
to be honest I mean more like remove these letters from this string and have only numbers
I thought you want to check if it contains number etc…
Anyhow use this.
System.Text.RegularExpressions.Regex.Replace(“string_Variable”,“\D”,“”)
Hope it will work
hmm Text is not a member of string
System.Text.RegularExpressions.Regex.Replace(“string_Variable”,“\D”,“”)
Hope it will work
I have updated the regex.
no idea why it doesnt work text is not a member of string and it doesnt compile
Did u try with the regex pattern I told ?
It is working for me…
System.Text.RegularExpressions.Regex.Replace(StringVar,“\D”,“”)
Output