Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

C# return dictionary string/integer from comparison of List and Array

      /// <summary>
        /// Return Dictionary of string/int from comparision of List and Array
        /// </summary>
        /// <param name="colHeaders">List from xml file</param>
        /// <param name="headers">Array from Csv File</param>
        /// <returns></returns>
        public static Dictionary<string, int> GetDictionaryOfListArray(List<string> colHeaders, string[] headers)
        {
            var indexes = new Dictionary<string, int>();
            for (int i = 0; i < headers.Length; i++)
            {
                indexes[headers[i]] = colHeaders.Contains(headers[i]) ? i : -1;
            }

            return indexes;
        }
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# add field to expando object 
Csharp :: How to add a button to a column in the DataGridView 
Csharp :: how to change something in the window using a thread wpf 
Csharp :: [1], [2], [3] 
Csharp :: fetch post .net 
Csharp :: fluent api c# hasmany withmany 
Csharp :: autoclicker for yes/no in c# indicator 
Csharp :: c# break file into words 
Csharp :: how download file from internet and move it to folder with c# 
Csharp :: How to execute a script after the c# function executed 
Csharp :: how to delete dotnet project 
Csharp :: c# expandoobject indexer 
Csharp :: unittest servicector automapper 
Csharp :: lambda not null c# 
Csharp :: linked list follow what in c# 
Csharp :: mental retardation 
Csharp :: how to remove all controls from panel c# 
Csharp :: c# parsing datetime from string irrespctive of culture 
Csharp :: unity check if swipe not tap 
Csharp :: c# how to load type of class from string 
Csharp :: cluster size C: powerschell 
Csharp :: c# gridview summary item displayformat 
Csharp :: asp.net core mvc razor page call pagemodel actio 
Csharp :: How to keep line breaks in SQL Server using ASP.NET and C#? 
Csharp :: simplified if statement c# 
Csharp :: variable with letters and numbers in C# 
Csharp :: parsing object from text file c# 
Csharp :: xml reader attributes 
Csharp :: my custom file watcher 
Csharp :: unity remove all child 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =