Exam UiARD All QuestionsBrowse all questions from this exam
Question 166

You have two string variables called Name and City. You want to construct a new sentence that includes the values from the following variables:

My name is and I live in

Which expression will provide the required output?

    Correct Answer: A

    To construct a new sentence that includes the values from the variables Name and City, you should use the String.Format method with placeholders where {0} corresponds to the first variable and {1} to the second. The correct expression that follows this format is String.Format('My name is {0} and I live in {1}', Name, City). This correctly references the values of the variables Name and City.

Discussion
Engineer24Option: A

Tested in Studio !

[Removed]Option: A

Given is correct