UiPath RPA Associate (UiRPA) — Question 34

Which expression should be used to return the first four characters from a String variable called StrVar?

Answer options

Correct answer: A

Explanation

The correct answer is A, as StrVar.Substring(0, 4) starts at index 0 and retrieves four characters. Options B and C both start at index 1, which omits the first character, and option D starts at index 4, which returns characters beyond the first four.