How to get numeric value from the "CUID 51000 / Zone B / Conversion Date: 9/2/2024" e.g. 5100

How to get numeric value from the “CUID 51000 / Zone B / Conversion Date: 9/2/2024” e.g. 5100

@Vishal_Verma1,

Use regex for this

numericValue = System.Text.RegularExpressions.Regex.Match(inputString, "\d+").Value

Thanks for the quick reply. In my case i need to fetch value after “CUID”

@Vishal_Verma1 ,

Use this one

numericValue = System.Text.RegularExpressions.Regex.Match(inputString, "(?<=CUID\s)\d+").Value

++

1 Like

value=System.Text.RegularExpressions.Regex.Match(inputString, "(?<=CUID\s)\d+").Value

Try this!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.