Regex for getting value from string. This value is different for different records.
60/hr ID 886904
Above is string in this i need to get 60. Please remember this string should be different for different records but /hr will remail same.
Regex for getting value from string. This value is different for different records.
60/hr ID 886904
Above is string in this i need to get 60. Please remember this string should be different for different records but /hr will remail same.
System.Text.RegularExpressions.Regex.Match(Input,"\d+(?=/hr)").Value
or
Input="60/hr ID 886904"
Input.Split("/")(0)
Hope this helps!!
Hi @Puneet_Singh1
Try this:
Input= "60/hr ID 886904"
Output= System.Text.RegularExpressions.Regex.Match(Input,"\d+(?=\/hr)").Value
Hope it helps!!
System.Text.RegularExpressions.Regex.Match(Input,“.*(?=/hr)”).Value
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.