Convert ArrayList() Collection to String [] Array

Problem Statement:

We have scenario where we have data stored in arraylist collection and want to pass this as data as input to Webservice method in string array format.

Namespace: System.collections


private string[] ConvertArrayListToStringArray(ArrayList arrList)

for (int iIter=0;iIter<5;iIter++)
return string[]arrList.ToArray(typeof(string));

Hope this codesnippet will help those who looking out for solution for given problem statement. All the best.


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: