Ok, here it goes.
I have a string called fileName which is dynamic. I want to see if it contains a string from an array called arrayOfStrings and if so grab the corresponding string from the array either by using IndexOf or creating a variable with the string in it. Then from there, using that variable as a dynamic variable in my replace activity.
Example:
fileName = “This is a string with the number one”
arrayOfStings = {“One”, “Two”, “Three”)
I want to be able to find something as follows;
If fileName.Contains(arrayOfStings, IndexOf array()) or something like that
Then assign the output to a variable such as arrayPulledIndex = arrayOfString.IndexOf.toString?
So the resulting variable would = “One”
Then I want to use that variable inside the new handy replace tool and set the Value to the new variable. From what I’ve played around with so far I don’t know if this is even possible in the activity.
The reason I’m doing this is I’m just trying to clean up some code. I know there is a better way then doing a bunch of if statements searching for sting.contains for each item. I’m attaching a visual to maybe help you all out
Any help with this would be greatly appreciated