N
Naz
Hi,
I am new in C# and converting a program from delphi to C#. I have to
store a list of strings in memory and also need to save the strings to
disk at the end. I use StringCollection and my program looks like
this...
stringCollection.Add("line1");
stringCollection.Add("line2");
stringCollection.Add("line3");
....
....
foreach(string entry in stringCollection)
{
Console.WriteLine(entry);
}
Q: I thought stringCollection.ToString() will return all entries but it
return "System.Collections.Specialized.StringCollection". Instead
iterate through all entries, can I use any built-in method to return
all entries (like in delphi stringlist.text())?
Q: Is StringCollection is best for my program which is to store the
strings in memory and may save the strings to disk at the end?
Thanks
I am new in C# and converting a program from delphi to C#. I have to
store a list of strings in memory and also need to save the strings to
disk at the end. I use StringCollection and my program looks like
this...
stringCollection.Add("line1");
stringCollection.Add("line2");
stringCollection.Add("line3");
....
....
foreach(string entry in stringCollection)
{
Console.WriteLine(entry);
}
Q: I thought stringCollection.ToString() will return all entries but it
return "System.Collections.Specialized.StringCollection". Instead
iterate through all entries, can I use any built-in method to return
all entries (like in delphi stringlist.text())?
Q: Is StringCollection is best for my program which is to store the
strings in memory and may save the strings to disk at the end?
Thanks