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:
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.
public static class ExtensionMethods
public static bool isUrl( this String str)
}
public static class ExtensionMethods
this String str