Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IEnumerable<string> Combine(IEnumerable<string> col1, IEnumerable<string> col2)
- {
- foreach(string item in col1)
- yield return item;
- foreach(string item in col2)
- yield return item;
- }
- class Program
- {
- static void Main(string[] args)
- {
- Collection<string> myitems = new Collection<string>();
- myMthod(ref myitems);
- Console.WriteLine(myitems.Count.ToString());
- Console.ReadLine();
- }
- static void myMthod(ref Collection<string> myitems)
- {
- myitems.Add("string");
- if(myitems.Count <5)
- myMthod(ref myitems);
- }
- }
Add Comment
Please, Sign In to add comment