Using Switch Statement to check if a string contains a word

I think you’re problem is that your expression always equals the full string so there is no Case for it to go to (I probably confused you).

Try using your .Contains in the expression, then use the String “SUCCESS” as the Case.

I’m not aware of a way to use a condition as the Case, so I normally just use the condition in the Expression, like I have presented in the example. I also added .ToUpper to remove case-sensitivity.

Regards.

3 Likes