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.
Correct answer is C
Agree, D is the right answer
C is the correct answer
https://msdn.microsoft.com/en-us/library/b9712a7w(v=vs.110).aspx
A gives groups array. Hence Tostring(0 method mentioned above won’t give desird result
https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.matchcollection(v=vs.110).aspx
Correct, good reference!
C
C
C is correct
C
C
121 is the same
C
C