list clone - C#
using System;
using System.Linq;
using System.Collections.Generic;
public class Example
{
public static void Main()
{
List<string> source = new List<string>() { "A", "B", "C" };
List<string> clonedList = source.ToList();
Console.WriteLine(String.Join(",", clonedList));
}
}
/*
Output: A,B,C
*/
static class Extensions
{
public static IList<T> Clone<T>(this IList<T> listToClone) where T: ICloneable
{
return listToClone.Select(item => (T)item.Clone()).ToList();
}
}
Also in C#:
- unity movement on forward
- change z value unity
- .netstandard distinctby iqueryable
- how to access the dictionary from another script in unity
- c# md5 int
- how to close a form c#
- mongodb custom IIdGenerator
- c# asp.net hover tooltip
- Assets\playermove.cs(30,37): error CS1003: Syntax error, ',' expected
- how to reference the position of a game object unity
- c# max sequence contains no elements
- c# string remove special characters
- asp.net list all files in folder
- s3 upload base64 .net core
- c# stop loop in method
- add spaces between words unity
- convert string array to int C#
- accessing form controls from another class c#
- the request was aborted could not create ssl/tls secure channel. c# restsharp
- how to stream video from vlc in c#
- string to uint c#
- Assets/Scripts/Snake.cs(177,25): error CS1061: Type `Snake.SnakeBodyPart' does not contain a definition for `SetGridPostion' and no extension method `SetGridPostion' of type `Snake.SnakeBodyPart' could be found. Are you missing an assembly reference?
- unity3d debug pause
- How to solve error in ExecuteNonQuery() in asp.net