zefrof
1
It’s been a while since I used python, but I remember being able to access everything stored in an array by doing the following:
array[0:]
having the colon after the zero meant you want to reference everything stored in the array. How would I go about this in C#?
kacyesp
2
That’s just syntactic sugar.
To know my knowledge, nothing like that exists in C#.
You can use a foreach loop:
int[] numbers = {4, 5, 6, 1, 2, 3, -2, -1, 0};
foreach (int i in numbers)
{
System.Console.WriteLine(i);
}