Friday, March 14, 2014

C# - Resizing Arrays - Add String to String Array

Guys,
here's a simple way to add a string to a string array (C#):

String[] Sorting;
foreach (String StringObj in StringObjCollection)
{
     Array.Resize(ref Sorting, Sorting.Length + 1);
     Sorting[Sorting.Length - 1] = StringObj;
}

No comments:

Post a Comment