How to add multiple conditions within an Assign activity

Hello,

Am trying to put place a statement in C#

System.Text.RegularExpressions.Regex.Matches(str,“MA”).Count && System.Text.RegularExpressions.Regex.Matches(str,“AT”).Count

but am unsure how to do so, any advise is greatly appreciated.

image
the code in the assign activity is
System.Text.RegularExpressions.Regex.Matches(str,“AT”).Count

my aim is to get it to count the total number of MA and AT found in str

Hi,

How about the following expression?

System.Text.RegularExpressions.Regex.Matches(str,"MA").Count +System.Text.RegularExpressions.Regex.Matches(str,"AT").Count

or

System.Text.RegularExpressions.Regex.Matches(str,"AT|MA").Count

Regards,

1 Like

awesome thanks!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.