lmoham
(Lmoham)
March 26, 2021, 7:40am
1
I would like to improve my process to accommodate for changes in the future and would like to change the bot from finding “LP” keywords to the number of times ‘+’ plus signs appear within a row is that possible?
I get this error when replacing “LP” with “+” using the code shown above
hi @lmoham
can u show thw excel column please?
lmoham
(Lmoham)
March 26, 2021, 7:43am
3
Heres the column for it, I would like to get the same results but finding ‘+’ plus signs instead of ‘LP’.
1 Like
(From row in outData.AsEnumerable() Where row.item(0).ToString.Contains(“+”) Select row.Item(0)).ToList()
you can use For each to print them and just do this to check Item.Count
Try this and let me know.
1 Like
Hi @lmoham
Please use the below method.
System.Text.RegularExpressions.Regex.Matches(yourVariable,“[+]”).count
Feel free to reach us at any time if you have doubts. Thanks.
Happy Automation
1 Like
Srini84
(Srinivas Kadamati)
March 26, 2021, 7:52am
6
@lmoham
Check as below
System.Text.RegularExpressions.Regex.Match(sampleString,"LP").Value.ToArray().Count()
Mark as solution if this helps you
Thanks
1 Like
lmoham
(Lmoham)
March 26, 2021, 8:07am
7
Thanks again and yes your code worked the way I desired!
Thanks to everyone chipping in too ^^
1 Like
system
(system)
Closed
March 29, 2021, 8:08am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.