Array To String - CSharp System

CSharp examples for System:String Format

Description

Array To String

Demo Code


using System.Text.RegularExpressions;
using System.Text;
using System.Globalization;
using System.Collections.Generic;
using System;//from  www .j av a  2 s.c o m

public class Main{
        public static string ArrayToString(Array input, string separator)
        {
            string ret = "";
            for (int i = 0; i < input.Length; i++)
            {
                ret += input.GetValue(i).ToString();
                if (i != input.Length - 1)
                    ret += separator;
            }
            return ret;
        }
}

Related Tutorials