Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Basics of .NET Collections in C#

, 10 Dec 2008 CPOL
This article focuses on managing collections in .NET Framework 2.0.
using System;
using System.Collections.Generic;
using System.Text;

namespace DotNetCollections
{
    public class Utility
    {
        /// <summary>
        /// Method to convert ToString()
        /// </summary>
        /// <param name="objects">objects array</param>
        /// <returns></returns>
        public static string ConvertToString(Array objects)
        {
            string strToReturn = string.Empty;

            if (objects != null)
            {
                foreach (object obj in objects)
                {
                    if (strToReturn.Length > 0)
                        strToReturn += ", ";

                    strToReturn += obj.ToString();
                }
            }
            return strToReturn;
        }

        public static string ConvertToString(System.Collections.ArrayList objects)
        {
            string strToReturn = string.Empty;

            if (objects != null)
            {
                foreach (object obj in objects)
                {
                    if (strToReturn.Length > 0)
                        strToReturn += ", ";

                    strToReturn += obj.ToString();
                }
            }
            return strToReturn;
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Shakeel Iqbal
Software Developer (Senior) TEO
Pakistan Pakistan
Passion and positive dedication is essential part of success. I believe on hardworking and sharing knowledge with others. I always try to be a better than I am and think positive for positive result.
 
My Blogs
Follow on   Twitter   Google+

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.1411023.1 | Last Updated 10 Dec 2008
Article Copyright 2008 by Shakeel Iqbal
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid