How should you complete the relevant code?

You are developing a class named ExtensionMethods
You need to ensure that the ExtensionMethods class implements the IsUrl() 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 area. Each code segment may be used once, more than once, or not at all.
You may need to drag the split bar between panes orscroll to view content.)

Select and Place:

You are developing a class named ExtensionMethods
You need to ensure that the ExtensionMethods class implements the IsUrl() 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 area. Each code segment may be used once, more than once, or not at all.
You may need to drag the split bar between panes orscroll to view content.)

Select and Place:

Answer:

Explanation:



Leave a Reply 3

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


MarcoJacob

MarcoJacob

I would say:

public static class ExtensionMethods
{
public static bool IsUrl(this String str)
{

Class must be “public” and “static” because method is public and static (static is necessary in case of using as ExtensionMethod) and “this” is necessary to add this Method for all string Objects.

Est

Est

public static class ExtensionMethods

public static bool isUrl( this String str)
}

LS

LS

public static class ExtensionMethods
this String str