window.ENTITIES={'/api/snippets/cs/c%23%20find%20element%20in%20list':[{"result":true,"message":null,"batch":{"type":"cs","name":"c# find element in list","items":[{"id":"pOzwJD","type":"cs","name":"c# find element in List","content":"List list = new List { \"A1\", \"A2\", \"B1\" };\nstring item = \"A2\";\n\nbool result = list.Contains(item); // True","source":"https://dirask.com/posts/C-NET-find-element-in-List-jvGaV1","author":{"id":"4a6xA0","name":"Broncono","avatar":"1629030394463__4a6xA0__w40px_h40px.png","points":466,"role":"BASIC"},"creationTime":1645812210000,"updateTime":null,"removalTime":null},{"id":"1XgWgj","type":"cs","name":"c# find element in List","content":"List list = new List { \"A1\", \"A2\", \"B1\" };\nstring search = \"A2\";\n\nint result = list.IndexOf(search); // 1","source":"https://dirask.com/posts/C-NET-find-element-in-List-jvGaV1","author":{"id":"JajbWa","name":"MMORex","avatar":"1629133252731__JajbWa__w40px_h40px.jpg","points":660,"role":"BASIC"},"creationTime":1645812212000,"updateTime":null,"removalTime":null},{"id":"DlV9kj","type":"cs","name":"c# find element in List","content":"List list = new List { \"A1\", \"A2\", \"B1\" };\nstring item = \"A2\";\n\nint result = list.FindIndex(x => x == item); // 1","source":"https://dirask.com/posts/C-NET-find-element-in-List-jvGaV1","author":{"id":"YoWewD","name":"Maryamcc","avatar":"1629142576003__YoWewD__w40px_h40px.jpg","points":511,"role":"BASIC"},"creationTime":1645812214000,"updateTime":null,"removalTime":null},{"id":"D7R4o1","type":"cs","name":"c# find element in List","content":"using System;\nusing System.Collections.Generic;\n\npublic class Program\n{\n public static void Main()\n {\n List list = new List { \"A1\", \"A2\", \"B1\" };\n string item = \"A2\";\n\n bool result = list.Contains(item);\n\n Console.WriteLine(result); // True\n }\n}","source":"https://dirask.com/posts/C-NET-find-element-in-List-jvGaV1","author":{"id":"4a6AJD","name":"Mariam-Barron","avatar":"1629130975585__4a6AJD__w40px_h40px.jpg","points":811,"role":"BASIC"},"creationTime":1645812216000,"updateTime":null,"removalTime":null},{"id":"1ARZKD","type":"cs","name":"c# find element in List","content":"using System;\nusing System.Collections.Generic;\n\npublic class Program\n{\n public static void Main()\n {\n List list = new List { \"A1\", \"A2\", \"B1\" };\n string search = \"A2\";\n\n int result = list.IndexOf(search);\n\n Console.WriteLine(result); // 1\n }\n}","source":"https://dirask.com/posts/C-NET-find-element-in-List-jvGaV1","author":{"id":"ZaEd2D","name":"Burhan-Boyce","avatar":"1629131214042__ZaEd2D__w40px_h40px.jpg","points":458,"role":"BASIC"},"creationTime":1645812217000,"updateTime":null,"removalTime":null},{"id":"pJqJ9D","type":"cs","name":"c# find element in List","content":"using System;\nusing System.Collections.Generic;\n\npublic class Program\n{\n public static void Main()\n {\n List list = new List { \"A1\", \"A2\", \"B1\" };\n string item = \"A2\";\n\n int result = list.FindIndex(x => x == item); // 1\n\n Console.WriteLine(result);\n }\n}","source":"https://dirask.com/posts/C-NET-find-element-in-List-jvGaV1","author":{"id":"409lKo","name":"TheDalot","avatar":"1629030450953__409lKo__w40px_h40px.png","points":390,"role":"BASIC"},"creationTime":1645812219000,"updateTime":null,"removalTime":null}]}}]};