Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- namespace CsharpStudy
- {
- /*
- * [ Generic List ]
- * [ Dictionary ]
- */
- internal class Program
- {
- static void Main(string[] args)
- {
- // list
- var list = new List<int>();
- list.Add(1);
- list.AddRange(new[] { 2, 3 });
- list.Remove(1);
- list.IndexOf(2);
- // Dictionary
- var dict = new Dictionary<string, string>();
- dict.Add("password", "12345");
- if (dict.ContainsKey("Email"))
- Console.WriteLine(dict["Email"]);
- if (!dict.ContainsKey("Email"))
- var isContain = dict.TryGetValue("password" , out var value);
- Console.WriteLine(value + ' ' + isContain);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement