How should you complete the relevant code?

DRAG DROP
You are developing a class named ExtensionMethods.
You need to ensure that the ExtensionMethods class implements the IsEmail() extension method on
string objects.
How should you complete the relevant code? (To answer, drag the appropriate code segments to
the correct locations in the answer are
a. Each code segment may be used once, more than once, or not at all. You may need to drag the
split bar between panes or scroll to view content.)

DRAG DROP
You are developing a class named ExtensionMethods.
You need to ensure that the ExtensionMethods class implements the IsEmail() extension method on
string objects.
How should you complete the relevant code? (To answer, drag the appropriate code segments to
the correct locations in the answer are
a. Each code segment may be used once, more than once, or not at all. You may need to drag the
split bar between panes or scroll to view content.)

Answer:



Leave a Reply 3

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


Lord Vader

Lord Vader

Extension methods are defined as static classes and static methods. the first parameter of the methodis the type of the class that you want to add the extension method to. it must be marked with the this keyword.
public static class STringExtensions {
public static string ToRandomCase(this string text){}}

u can then call it via text.ToRandomCase();