Which two code segments can you use to achieve this goal?

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.)

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

Explanation:
* 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.



Leave a Reply 0

Your email address will not be published. Required fields are marked *