I am trying to add 2 new array items to existing string array. I achieved the result but I am sure this is not the right way to do .
How can I add items to a string array.
string[] sg = {"x", "y" };
string[] newSg = {"z", "w"};
string[] updatedSg = new string[sg.Length+newSg.Length];
for (int i = 0; i < sg.Length; i++)
{
updatedSg[i] = sg[i];
}
for (int i = 0; i < newSg.Length; i++)
{
updatedSg[sg.Length+i] = newSg[i];
}