Answers for "add item to an array c#"

C#
9

c# add element to array

private T[] AddElementToArray<T>(T[] array, T element) {
    T[] newArray = new T[array.Length + 1];
    int i;
    for (i = 0; i < array.Length; i++) {
        newArray[i] = array[i];
    }
    newArray[i] = element;
    return newArray;
}
Posted by: Guest on November-24-2020
0

c# how to append in array

List<string> ls = new List<string>();
ls.Add("Hello");
Posted by: Guest on September-27-2020
0

append an array in c#

int[] terms = new int[400];
for (int runs = 0; runs < 400; runs++)
{
    terms[runs] = value;
}
Posted by: Guest on March-28-2021
-2

add item to an array c#

List<string> l = new List<string>(){"one","two","tree","four",};
Posted by: Guest on October-01-2020

Code answers related to "add item to an array c#"

C# Answers by Framework

Browse Popular Code Answers by Language