A Function To Concat String Array Values By Specified Delimiter

Let 's Say I have Following Array:

string[] st = new string[5];
st[0] = "Animation";
st[1] = "Action";
st[2] = "Romance";
st[3] = "Drame";
st[4] = "Comedy";

Now I want to Merge all of it with ',' Delimiter Like Below:

Output : Animation,Action,Romance,Drame,Comedy

We will Call it Like This:
string str = GetAllStringsFromArrary( st,",");

Check here for better understanding: [snipped]

commented: use string.Join!! -2
public string GetAllStringsFromArrary(string[] strArray,string strDelimeter)
        {
            string strFinal = string.Empty;
 
            for (int i = 0; i < strArray.Length ; i++)
            {
                strFinal += strArray[i];
 
                if (i != strArray.Length - 1)
                {
                    strFinal += strDelimeter;
                }
            }
            return strFinal;
             
 
        }

This function is provided by string.Join.
e.g. string.Join(", ", Values);

ohhh.. wow. thanks.. i never realized it.. thanx again . :)

Being a Posting Whiz, Have you never come across string.split and string.join inbuilt methods??..

my first comment was a little sarcasm .. yes i know about string.split and string.join very well..

this was snippet was made very long ago.. i just posted it here to share ...

and the title Posting Wiz doesn't mean i know it all.. even the most talented people have flaws.. :)

commented: polite enough. +13

I was trying to apply what you've posted, thank you