Abundant Code

  • C#
  • C++
  • Elastic Search
  • Entity Framework
  • F#
  • JavaScript
  • ASP.NET
  • C
  • Java
  • SQL Server
  • Assembly Lang
Home ยป Collection

How to Create an Empty array without defining the size in C# ?

February 16, 2017 by AbundantCode Leave a Comment

When we create an array in C# , we tend to define the size of the array as shown below. Can we create an array without defining the size ? The best option in this  scenario is to use the collection. You can use the Generic List which allows you to add as many items […]

Filed Under: C# Tagged With: Array, C#, Collection

How to Get the number of elements in ArrayList in C# ?

October 7, 2016 by AbundantCode Leave a Comment

Here’s the code that demonstrates how one can get the total number of elements contained in the ArrayList using C# using the Count property of the ArrayList. How to Get the number of elements in ArrayList in C# ?

Filed Under: C# Tagged With: ArrayList, Collection, csharp, How to

How to Check if the ArrayList is read-only in C# ?

October 7, 2016 by AbundantCode 1 Comment

There are times when you would use the read-only wrapper in order to prevent modifying the ArrayList. We use the ArrayList.ReadOnly method to create such collection. When doing so , you might want to check if the ArrayList is Read-only or not. How to Check if the ArrayList is read-only in C# ? Use the […]

Filed Under: C# Tagged With: ArrayList, Collection, csharp, How to

Using HashSet to remove duplicates from array in C#

May 11, 2016 by AbundantCode Leave a Comment

If you want to remove duplicates from an array in C# , one of the options is to use HashSet as shown below. How to remove duplicates from an array in C# using HashSet?

Filed Under: C# Tagged With: Array, Collection, duplicate, Generic, HashSet

How to make a Type Sortable on Different Criteria in C# ?

April 22, 2016 by AbundantCode Leave a Comment

IComparable interface is a great way to sort your objects by using the sorting routines of the List. There is a another interface called IComparer<T> which allows the objects to be sorted based on different criteria. How to make a Type Sortable on Different Criteria in C# ? For example , if you wanted to […]

Filed Under: C# Tagged With: C#, Collection, IComparer, interface

How to Add item to the beginning of List in C# ?

February 7, 2016 by AbundantCode 1 Comment

If you want to add or insert an item to the beginning of the List in C# , you can use the Insert method defined in the collection as shown below. How to Add item to the beginning of List in C# ? using System; using System.Collections.Generic; using System.Linq; namespace ACCode {     class Program […]

Filed Under: C# Tagged With: C#, Collection, How to, List

How to Get the Dictionary Key by value in C# ?

February 7, 2016 by AbundantCode Leave a Comment

If you want to get the Key of a dictionary based on the value in C# , you can use the LINQ’s where clause o FirstOrDefault method. How to Get the Dictionary Key by value in C# ?

Filed Under: C# Tagged With: C#, Collection, Dictionary, How to

How to Get the Top 5 elements from a List in C# ?

February 5, 2016 by AbundantCode Leave a Comment

If you want to get the top 5 elements from a list in C# or skip the first item and get the next five elements from a List , you can use the Take and the Skip methods. How to Get the Top 5 elements from a List in C# ? Below is a sample […]

Filed Under: C# Tagged With: Collection, csharp, LINQ, List

How to convert List<string> to string with comma delimiter in C# ?

January 27, 2016 by AbundantCode Leave a Comment

If you need to convert a collection (for example List of string) to string separated with the Comma as delimiter , you can either use the string.join method or aggregate method as shwon below. How to convert List<string> to string with comma delimiter in C# ?

Filed Under: C# Tagged With: Collection, CSharp.Dotnet

How to update the value in a Dictionary in C# ?

January 25, 2016 by AbundantCode Leave a Comment

Below is a sample code snippet demonstrating how to update the value that is stored within the dictionary using C#. We access the dictionary with the key as index and set the value. How to update the value in a Dictionary in C# ?

Filed Under: C# Tagged With: Collection, csharp, Dictionary, Update

  • 1
  • 2
  • Next Page »
RSS
Facebook
fb-share-icon
Twitter
Visit Us
Follow Me
Tweet

Recent Posts

  • Collapsible links for subcategories in Docusaurus Sidebar
  • Python Program to Print Fibonacci Series
  • Python Program to Generate Multiplication Table
  • Python Program to Find the Factorial of a Number
  • Python Program to Print Prime Numbers in a Given Interval

Categories

Tags

.NET App Array ASP.NET ASP.NET MVC Assembly Language C# C# programs c lab programs Collection convert C program csharp database Example F# guide How to How to in Java integer Java Javascript Lab programs Lambda LINQ List Python lab programs Python programs SIC/XE SQL Server string tips tricks tutorial tutorials UWP visual studio 2015 Windows Windows 8 Windows 10 Windows Phone Windows Phone 8 Windows Phone 8.1 wp8 XAML

Blog Stats

  • 8,729,417 hits

Archives

Top Posts & Pages

  • C Program to Multiply Two Matrices Using Multi-dimensional Arrays
  • How to Convert a Stream to Byte Array in C# 4.0 ?
  • How to open display settings from command line in Windows 10 ?
  • C Program to display half-pyramid using alphabets
  • How to Extract number from a string using C# ?
  • System Software - SIC/XE Program to clear 20 byte string to empty
  • Tools to Convert Java to C# Source Code
  • Json.NET & VB.NET - How to Deserialize an Object ?
  • How to Check if Integer is a multiple of a number in Java?
  • C# Program - How to Calculate Age based on DateTime ?

Categories

  • Android
  • Angular 2
  • ASP.NET
  • Assembly Language
  • C
  • C#
  • C++
  • Elastic Search
  • Entity Framework
  • Excel
  • F#
  • HTML
  • Interview Questions
  • Java
  • JavaScript
  • jQuery
  • Microsoft Office
  • MySQL
  • NETWORK
  • News
  • PHP
  • popular
  • PowerShell
  • Python
  • Ruby
  • SharePoint
  • SQL Server
  • SQL Server
  • Unix
  • VB.NET
  • Visual Studio
  • WebAPI
  • Windows
  • Windows Azure
  • Windows Forms
  • XAML

Top Posts & Pages

  • C Program to Multiply Two Matrices Using Multi-dimensional Arrays
  • How to Convert a Stream to Byte Array in C# 4.0 ?
  • How to open display settings from command line in Windows 10 ?
  • C Program to display half-pyramid using alphabets
  • How to Extract number from a string using C# ?
  • System Software - SIC/XE Program to clear 20 byte string to empty
  • Tools to Convert Java to C# Source Code
  • Json.NET & VB.NET - How to Deserialize an Object ?
  • How to Check if Integer is a multiple of a number in Java?
  • C# Program - How to Calculate Age based on DateTime ?

Recent Posts

  • Collapsible links for subcategories in Docusaurus Sidebar
  • Python Program to Print Fibonacci Series
  • Python Program to Generate Multiplication Table
  • Python Program to Find the Factorial of a Number
  • Python Program to Print Prime Numbers in a Given Interval
  • Python Program to Check Prime Number
  • Python Program to Find the Largest Value Among Three Numbers
  • Python Program to Check If a Given Year is Leap Year
  • Python Program to Check if a Number is Odd or Even
  • Python Program to Check if a Number is Positive, Negative or Zero

Tags

.NET App Array ASP.NET ASP.NET MVC Assembly Language C# C# programs c lab programs Collection convert C program csharp database Example F# guide How to How to in Java integer Java Javascript Lab programs Lambda LINQ List Python lab programs Python programs SIC/XE SQL Server string tips tricks tutorial tutorials UWP visual studio 2015 Windows Windows 8 Windows 10 Windows Phone Windows Phone 8 Windows Phone 8.1 wp8 XAML