c# - iterating through an array -


Although the array is not a problem, but if I want to increase only when the method is called?

I'm not sure this will work but there is an easy way to do this

  int counter; String [] myArray = {"foo", "bar", "something", "and", "here"}; Private string GetNext () {string myValue = string.Empty; If (counter  

What is the Iterator you want

  Private Inenimbable & lt; String & gt; My intent () {foreach (myArray in String I.) {yield returns i; }}  

However only myArray.GetEnumerator () is calling;

  string [] myArray = {"foo", "bar", "something", "else", "here it has been used."}; IEnumerator & LT; String & gt; MyEnum; Private string GetNext () // believe that at least 1 elements will be present in my array. {If (myEnum == faucet) myEnum = myArray.GetEnumerator (); If (MyEnum.MoveNext ()) {myEnum.Reset (); MyEnum.MoveNext (); } Make my ultimate return. Present; }  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -