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 / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Array String

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Piero - 04 Mar 2008 09:40 GMT
Hi,
i must create an string array to save a record of a txt file.... the
number of record is't the same...
someone can help me?
thanks
Jon Skeet [C# MVP] - 04 Mar 2008 09:47 GMT
> i must create an string array to save a record of a txt file.... the
> number of record is't the same...
> someone can help me?

It would help if you could give a bit more information. Is there any
reason why you need to use an array instead of a List<string> which
you can keep adding to? How are you going to populate the array? What
will you do with it afterwards?

Jon
Piero - 04 Mar 2008 11:15 GMT
> > i must create an string array to save a record of a txt file.... the
> > number of record is't the same...
[quoted text clipped - 6 lines]
>
> Jon

i have a file txt: address book.txt. in this file any record is a
different person; in the record there are some information like
'name', 'phone','address' and any other...
i create a class that import a file and save a single information of
record in a different place of array.when all information of one
record is saved, i must write a new file with part of this
information. All of operation, are in a "FOR" loop or cycle( i don't
now which word is better )
can you understand?

thanks
Jon Skeet [C# MVP] - 04 Mar 2008 11:30 GMT
> > It would help if you could give a bit more information. Is there any
> > reason why you need to use an array instead of a List<string> which
[quoted text clipped - 4 lines]
> different person; in the record there are some information like
> 'name', 'phone','address' and any other...

Okay - and how are those stored?

> i create a class that import a file and save a single information of
> record in a different place of array.when all information of one
> record is saved, i must write a new file with part of this
> information. All of operation, are in a "FOR" loop or cycle( i don't
> now which word is better )
> can you understand?

Well, it sounds like a List<Person> will be fine.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Piero - 04 Mar 2008 14:47 GMT
> > > It would help if you could give a bit more information. Is there any
> > > reason why you need to use an array instead of a List<string> which
[quoted text clipped - 19 lines]
> Jon Skeet - <sk...@pobox.com>http://www.pobox.com/~skeet  Blog:http://www.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk

the file are stored in c:\Test

then, you think that i must use a ListArray and not Array to
"increase" the performance?
thanks
Jon Skeet [C# MVP] - 04 Mar 2008 15:07 GMT
> the file are stored in c:\Test

That's *where* they're stored - I was asking about *how* the data is
stored, i.e. the format.

> then, you think that i must use a ListArray and not Array to
> "increase" the performance?

No, I think you should use a List<string> (or ArrayList, or something
similar) rather than an array so that you don't need to know how many
items to create before you start.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Piero - 04 Mar 2008 16:23 GMT
> > the file are stored in c:\Test
>
[quoted text clipped - 11 lines]
> Jon Skeet - <sk...@pobox.com>http://www.pobox.com/~skeet  Blog:http://www.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk

ok, Jon thanks a lot!!
bye!

Rate this thread:







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.