Converting a MatchCollection into an ArrayList?


i've got question - simplest way convert matchcollection regex search arraylist?

on similar note, it's of underlying point of confusion me - there difference between two?  both appear one-dimensional array, seems strange sort of redundancy.


c# newbie, learning on go. ask lot of followup questions answers given, fair warning , all.



hi thequinch;

question, "what simplest way convert matchcollection regex search arraylist?", simplest way when creating arraylist supply matchcollection parameter following:

// mc object in following statement matchcollection
arraylist arraylist = new arraylist(mc);

question, "is there difference between two?  they both appear one-dimensional array, seems strange sort of redundancy.", yes there is. when work objects in arraylist working objects of system.object when retrieve element of arraylist need cast underlaying data type gain access properties. when working matchcollection working typed collection not need cast , compiler can compile time checking make sure there no error in code.

  


fernando (mcsd)

if post answers question, please click "mark answer" on post , "mark helpful".



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'