A developer has created a string array variable as shown below:
UserNames = {"Jane", "Jack", "Jill", "John"}
Which expression should the developer use in a Log Message activity to print the elements of the array separated by the string ", "?
- String.Join(UserNames, ",")
- String.Join(", ", UserNames)
- String.Concat(UserNames,",")
- String.Concat(",", UserNames)
Answer(s): B
Explanation:
The String.Join method takes two parameters: a separator and an array of strings. It returns a new string that concatenates the elements of the array using the separator. The correct syntax is String.Join(separator, array). Therefore, option B is the correct answer.
Reference:
Automation Developer Associate Training course, Section 1: Data Manipulation, Lecture: Data
Manipulation with Strings in Studio
How to use Array of string forum post, Answer by @balupad14
Reveal Solution Next Question