UiPath Advanced RPA Developer (UiARD) — Question 29
You have two lists in a workflow:
1. FranceCities which contains city names in France
2. IndiaCities which contains city names in India
In order to show all city names from both lists, which expression should be used as the input to a MessageBox?
Answer options
- A. String.Join(",", FranceCities.ToString + IndiaCities.ToString)
- B. FranceCities.Concat(IndiaCities).ToList.ToString
- C. String.Join(",", Enumerable.Concat(FranceCities, IndiaCities).ToList)
- D. Enumerable.Concat(FranceCities, IndiaCities).ToString
Correct answer: C
Explanation
The correct answer is C because it effectively concatenates the two lists using Enumerable.Concat, converts the result to a list, and joins the city names into a single string. Option A incorrectly uses ToString on the lists which will not provide the desired output. Option B does not format the output correctly for a MessageBox, and option D does not convert the concatenated result into a string format suitable for display.