exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 101 discussion

Actual exam question from Microsoft's 70-483
Question #: 101
Topic #: 2
[All 70-483 Questions]

You are developing an application by using C#. The application includes a method named SendMessage. The SendMessage() method requires a string input.
You need to replace "Hello" with "Goodbye" in the parameter that is passed to the SendMessage() method.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: BC 🗳️
The first parameter should be Hello.

✑ String.Replace Method (String, String)
Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string.
This method does not modify the value of the current instance. Instead, it returns a new string in which all occurrences of oldValue are replaced by newValue.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
supersunny
Highly Voted 5 years, 12 months ago
BC make sense indeed
upvoted 14 times
...
Sully_2020
Most Recent 5 years, 4 months ago
B and C. The question states that you need to replace "Hello" with "Goodbye" in the parameter that is passed to the SendMessage() method. It doesn’t state that you need to change the value of the message variable.
upvoted 2 times
...
peter1994
5 years, 10 months ago
B is the only correct answer. Method String.Replace create a new string, it does not change the value of the existing string.
upvoted 2 times
asdf652434
5 years, 9 months ago
At least now C is also correct since the result of the Replace() method is assigned to the message variable
upvoted 6 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...