T
Tony Johansson
Hi!
I know I can use the foreach. This is just for understanding.
My question is if the rows marked with 1 below is doing the exact same thing
as those that are marked with 2. ?
Which is to say if the construction between rows marked with 1 and 2 are
identical ?
public static void Main()
{
List<string> stringList = new List<string>();
stringList.Add("opel");
stringList.Add("saab");
stringList.Add("volvo");
stringList.Add("fiat");
1 IEnumerator e = stringList.GetEnumerator();
1 while (e.MoveNext())
1 Console.WriteLine(e.Current);
2 List<string>.Enumerator e = stringList.GetEnumerator();
2 while (e.MoveNext())
2 Console.WriteLine(e.Current);
}
//Tony
I know I can use the foreach. This is just for understanding.
My question is if the rows marked with 1 below is doing the exact same thing
as those that are marked with 2. ?
Which is to say if the construction between rows marked with 1 and 2 are
identical ?
public static void Main()
{
List<string> stringList = new List<string>();
stringList.Add("opel");
stringList.Add("saab");
stringList.Add("volvo");
stringList.Add("fiat");
1 IEnumerator e = stringList.GetEnumerator();
1 while (e.MoveNext())
1 Console.WriteLine(e.Current);
2 List<string>.Enumerator e = stringList.GetEnumerator();
2 while (e.MoveNext())
2 Console.WriteLine(e.Current);
}
//Tony