Languages
[Edit]
EN

C# / .NET - convert Array to List

8 points
Created by:
Marcin
2462

1. Enumerable.ToList method example

int[] array = new int[]
{
	1, 2, 3
};

List<int> list = array.ToList();

foreach (int entry in list)
	Console.Write(entry + " ");

Output:

1 2 3

2. References

  1. Enumerable.ToList Method - Microsoft Docs
Hey 👋
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.