Shivaraju
(UipathLearner)
1
Hi All,
I’m trying to get a range of number from a string.
Input:- Volume to be considered is 1-3.
Expected Output: 1-3
System.Text.RegularExpressions.Regex.Replace(“string_Variable”,“\D”,“”)
With the above code, am getting the output is 13
Can anyone please suggest me how to solve this issue.
Manish540
(Manish Shettigar)
2
Use \d{0,3} or \d{1,3}.
System.Text.RegularExpressions.Regex.Replace(“string_Variable”,“\d{1,3}”,“”)
1 Like
Shivaraju
(UipathLearner)
3
@Manish540,
Could you please check your code, it is not giving the expected output.
Yoichi
(Yoichi)
4
Hi,
Can you try the following?
System.Text.RegularExpressions.Regex.Match(string_Variable,"\d+-\d+").Value
Regards,
2 Likes
Manish540
(Manish Shettigar)
5
Use this,
System.Text.RegularExpressions.Regex.Replace(“string_Variable”,“\d{0,9}\-\d{0,9}”,“”)
Shivaraju
(UipathLearner)
6
1 Like
system
(system)
Closed
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.