Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2005

Tip: Looking for answers? Try searching our database.

Copy the contents of one StringCollection to another

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Diego Barros - 15 Jul 2005 02:45 GMT
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
Cowboy (Gregory A. Beamer) - MVP - 15 Jul 2005 14:09 GMT
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.

Signature

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

***************************
Think Outside the Box!
***************************

> Hi all,
>
[quoted text clipped - 9 lines]
> Cheers,
> Diego
Diego Barros - 18 Jul 2005 00:30 GMT
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

> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.