Extract Part of specific string variable

Hi
I want to extract information from my variableName whose value changes every time
Here are few sample examples
1.QUICK AUTO TRANSIT LLC
2.ALWA, INC., EXPORT & IMPORT
3.ALGA INVESTMENT GROUP, LLC
4. AL-WADI CORPORATION
And it varies every time
The question is I want to extract INC, LLC, and CORPORATION from my variable i-e if my output is QUICK AUTO TRANSIT LLC i want to get LLC ,
If my variable value is AL-WADI CORPORATION i want CORPORATION like that
.

  1. How to achieve this
  2. I want to write if statement if my variable = LLC or INC or CORPORATION (Any one from these)then it return INC or LLC or CORPORTAION (that exists in my VariableName)as an output

Hi @Aima_Arif

You can try with Regular Expression

System.Text.RegularExpressions.Regex.Match(YourString,"LLC|INC|CORPORATION").Tostring

In the If activity You can try with this below expression

System.Text.RegularExpressions.Regex.IsMatch(YourVariable,"LLC|INC|CORPORATION")

image

image

Regards
Gokul

1 Like

Thank You so much

1 Like

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