Example-
String - 235-65-r17-108-h-26093672-pn
Need Result- 26093672
Thanks in advance
Example-
String - 235-65-r17-108-h-26093672-pn
Need Result- 26093672
Thanks in advance
Split your text by β-β
Join last two elements of the array by β-β
Hi @smrutismita.samal ,
System.Text.RegularExpression.Regex.Matches(extractedText,β\d{8}.*$β)(0).Value
You can try this.
Thanks for your response.
Split your text by β-β : This returns System.String
It returns an Array of Strings. That allows you to combine the last two members of the array into the result that you want. Whatβs your question specifically?
Hi @smrutismita.samal, welcome to the Community.
Try this:
stringData.Split("-"c)(5).ToString
Output:
Hope this helps,
Best Regards.
How to check split value from -System.String
I have dynamic string value -
eg- -108-h-20093972-pn
eg- -1095-p-20393972-pn
eg- -82-v-29866091-pn
I want Result like below -
1 . 20093972
2. 20393972
3. 29866091
Since numbers are 8 digit always,
This will work : β\d{8}.*$β
System.Text.RegularExpression.Regex.Matches(extractedText,β\d{8}.*$β)(0).Value
Hi,
If you want to extract 8 digit value, the following will work.
System.Text.RegularExpressions.Regex.Match(yourString,"(?<=-)\d{8}(?=-)").Value
Regards,
Oh, you edited your original requirement. So you no longer require β-pnβ, just the numbers right before?
In that case your result is simply MyArray(MyArray.Count-2)
which is just taking the 2nd last element from the array.
Sure, hereβs an example UiPath workflow to extract the result β26093672β from the given string β235-65-r17-108-h-26093672-pnβ:
Value: 235-65-r17-108-h-26093672-pn
Thanks Its working fine.
thanks for your response
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.