Click here to Skip to main content
12,351,944 members (31,654 online)
Click here to Skip to main content

Tagged as

Stats

248.1K views
2.3K downloads
73 bookmarked
Posted

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

You may also be interested in...

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