You need to ensure that the method extracts a list of URLs that match the following pattern: @http://(www\\.)?([^\\.]+)\\.com; Which code should you insert at line 07?

You write the following method (line numbers are included for reference only):

You need to ensure that the method extracts a list of URLs that match the following pattern:
@http://(www\\.)?([^\\.]+)\\.com;
Which code should you insert at line 07?

You write the following method (line numbers are included for reference only):

You need to ensure that the method extracts a list of URLs that match the following pattern:
@http://(www\\.)?([^\\.]+)\\.com;
Which code should you insert at line 07?

A.
Option A

B.
Option B

C.
Option C

D.
Option D

Explanation:
* MatchCollection
Represents the set of successful matches found by iteratively applying a regular expression pattern
to the input string.
The collection is immutable (read-only) and has no public constructor. The Regex.Matches method
returns a MatchCollection object.
* List<T>.Add Method
Adds an object to the end of the List<T>.
Incorrect:
Not D: ICollection.SyncRoot Property
For collections whose underlying store is not publicly available, the expected implementation is to
return the current instance. Note that the pointer to the current instance might not be sufficient for
collections that wrap other collections; those should return the underlying collection’s SyncRoot
property.



Leave a Reply 11

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


sv1slim

sv1slim

The answer is C:

Najlepszy Programista Swiata DAGO

Najlepszy Programista Swiata DAGO

C

JOSE ANTONIO M

JOSE ANTONIO M

WTF

C!!

Twórca C#

Twórca C#

C jak cycki

harsh

harsh

why B cant be the answer?

Mike

Mike

1.) The variable “result” is already a list.
2.) myMatches.GetEnumerator gives you a “System.Text.RegularExpression.MatchEnumerator” which can not be casted to a generic list.

Lord Vader

Lord Vader

Mikes justification is incorrect.

mymatches.getenumerator -> iennumerator \\IEnumerator is the base interface for all non-generic enumerators.

The generic version of this interface is IEnumerator. u cannot cast the generic version to the non genetic one.

they are not ancestor classes so cant cast implicitly or explicitly

Najlepszy Programista

Najlepszy Programista

C