Array not ArrayList

  • Thread starter Thread starter John Sutor
  • Start date Start date
J

John Sutor

In a web service you cannot pass an ArrayList pback to the calling app.
I want to use an Array, but I will not always know the number of
elements to declare the array. I am simply reading in a file lin by
line and want to put each line in a string array, but each file varies
in the amount of lines it has. Can anyone show me a code snippet of how
to do this?
 
You could create an Array after you have added the items to the ArrayList.

string [] result = (string []) al.ToArray(typeof(string));
 
Back
Top