Total Page Preview:   000000000381

What is dictionary in C-Sharp in English and Hindi

 

Dictionary in C-Sharp in English:

In C#, a dictionary is a collection type that stores key-value pairs. Each key in the dictionary must be unique, and it is used to retrieve its associated value. The dictionary is implemented using a hash table, which provides fast access to the values based on their keys.

Here's an example of how to create and use a dictionary in C#:

 
This example creates a dictionary that maps string keys to integer values, adds some key-value pairs to it, retrieves a value by its key, checks if a key exists in the dictionary, removes a key-value pair from the dictionary, and loops through all the key-value pairs in the dictionary.
 
 
Dictionary in C-Sharp in Hindi:
C# mein dictionary ek collection type hota hai jo key-value pairs ko store karta hai. Har ek key dictionary mein unique honi chahiye, aur wo uss key se associated value ko retrieve karne ke liye use hoti hai. Dictionary hash table ka use karti hai, jisse ki keys ke basis par values tak fast access provide kiya ja sakta hai.
Neeche ek example diya gaya hai ki kaise C# mein dictionary ko create aur use kiya ja sakta hai:
 
 
Is example mein, ek dictionary create kiya gaya hai jo string keys ko integer values se map karta hai, ismein kuch key-value pairs add kiye gaye hai, ek value ko uss key ke basis par access kiya gaya hai, check kiya gaya hai ki kya dictionary mein ek key hai ya nahi, ek key-value pair ko dictionary se remove kiya gaya hai aur dictionary ke saare key-value pairs mein loop chalaya gaya hai.
 
 
 
 
 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: