add all elements in a list c#
using System.Collections.Generic;
using System.Linq;
List<int> intList = new List<int>(){1, 2, 3, 4};
int sum = intList.Aggregate((x, y) => x + y);
add all elements in a list c#
using System.Collections.Generic;
using System.Linq;
List<int> intList = new List<int>(){1, 2, 3, 4};
int sum = intList.Aggregate((x, y) => x + y);
how to add to a list c#
var list = new List<string>();
list.Add("Hello");
c# add list to list
using System;
using System.Collections.Generic;
namespace add_list
{
static void Main(string[] args)
{
List<string> first = new List<string> { "do", "rey", "me" };
List<string> second = new List<string> { "fa", "so", "la", "te" };
first.AddRange(second);
foreach(var e in first)
{
Console.WriteLine(e);
}
}
}
}
how to add data in list in c#
List<geo_tag> abc = new List<geo_tag>();
geo_tag tag = new geo_tag();
tag.latitude = 111;
tag.longitude = 122;
tag.unit = "SSS";
abc.Add(tag);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us