UiPath Automation Developer Associate v1 — Question 33

Which is the valid syntax for checking if the StrVar variable of type String includes the word "robot"?

Answer options

Correct answer: C

Explanation

The correct option is C, as the Contains method is specifically designed to check if a string includes a specified substring. Option A is incorrect because Equalsf is not a valid method for this purpose. Option B incorrectly tries to use Substring in the wrong context, and option D misapplies Substring by attempting to pass a string instead of an index.