Team, Need to extract required string where Input can be vary but desired output is required.
Input1 = Showing 1-20 of 21 results
Output = 21
Input2 = Showing 1-20 of 10983 results
Output = 10983
Note It should be case sensitive (ie both capital and small alphabets should work).
Thanks in advance
You can use string.split(" "c) and then get the number based on its index
or use regex
Regards
ppr
(Peter)
5

strtext = Your Text
strPattern = "(?<=\d+ of )\d+"
strValue = System.Text.RegularExpressions.Regex.Match(strText, strPattern).Value
Gokul001
(Gokul Balaji)
6
Hi @prerna.gupta
You can try with Regex expression
System.Text.RegularExpressions.Regex.Match(YourString,"\d+(?=\sresults)").Tostring

Regards
Gokul
1 Like
If we need to further verify strValue > 10K then do we need data type changes ? As string wont support double data type
ppr
(Peter)
8
focus on this topic scoped to 1 Topic = 1 case on extraction.
For need on conversion just open a new topic and share with us all samples, that you are expecting. Thanks
system
(system)
Closed
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.