I’m using get text to capture the screen of the terminal, and set the output as ab.
TEXT1 is the text I want to capture on the screen.
What would the coding be if I want to check the no. of times the word TEXT1 appear on the screen, is it by using contains?
can be done with RegEx Matches
@christine.tzenghy Use Matches activity and pass your Input String and pattern as TEXT1
then use assign activity to get the count of matches like result.Count.ToString
Can I use something like this?
I got an error which state that count is not a member of boolean after trying to run the code.
What would be the input ?
Output of the get text?
Input would be
ab in your case and output will be a collection
You need to get a count of Matches via assign activity
@Arpit_Kesharwani Thanks but I got the below error after trying
Compiler error(s) encountered processing expression “result.Count.ToString”.
‘String’ cannot be converted to ‘System.Collections.Generic.IEnumerable(Of System.Text.RegularExpressions.Match)’ because ‘Char’ is not derived from ‘System.Text.RegularExpressions.Match’, as required for the ‘Out’ generic parameter ‘T’ in ‘Interface IEnumerable(Of Out T)’.
can you share the screenshot of workflow
Sorry I couldn’t share the workflow. Do you mind to tell me what should be the variable type of result?
@Arpit_Kesharwani What should I put the variable type of “return” variable? Is it a string?
@christine.tzenghy No its not a string. Just press ctrl+k in the Result, It will create a new variable of type IEnumerable
@Arpit_Kesharwani Thanks so much, it is working now.
@christine.tzenghy Can you please mark the reply as a solution
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.