Copy the contents of one StringCollection to another

  • Thread starter Thread starter Diego Barros
  • Start date Start date
D

Diego Barros

Hi all,

This is probably something I have completely missed, but how do I copy the
contents of one StringCollection to another?

Do I have to go from StringCollection to array to StringCollection to do
this? I thought there'd be a simple StringCollection.Clone() or something
similar.

Thanks in advance.

Cheers,
Diego
 
I assume you are meaning a deep copy where the entire collection becomes a
new collection. If so, you can iterate through the collection, as it uses
IList. You can then use Add() to add to your new collection. There is no need
to pull into an array and then a collection.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Hi,

Thanks for the reply. I thought it would have something as straightforward,
and as logical, as source.Copy(destination) or something like that. Thanks
anyway, appreciate your reply.

Cheers,
Diego
 
Back
Top