BorislavBorisov

! List-промяна на стойност на индекс позиция

Sep 27th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. /*Може да ходиме по индексите и да ги променяме, без проблем*/
  4. class UsingList
  5. {
  6.     static void Main()
  7.     {
  8.         List<string> list = new List<string>() { "we", "we", "we" };//"!!", "!!", "Bad Thinks"
  9.  
  10.         for (int i = 0; i < list.Count; i++)
  11.         {
  12.             list[i] = "!!";
  13.         }
  14.         list[2] = "Bad Thinks";
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment