|
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.