However a HashSet collection is not sorted and cannot contain duplicate elements. At that time when you need to collection in sorted order then you can use the List<t> class together with the Sort method or if you are on .net framework 4 then you can use the SortedSet<t> class. Continue reading “How to sort HashSet<t> object”
Tag: .Net framework 4.5
The .NET Framework is a software framework developed by Microsoft that runs primarily on Microsoft Windows. .NET Framework 4.5 was released on 15 August 2012.,[27] a set of new or improved features were added into this version. (Source: Wikipedia licensed under CC BY-SA)
External Links
www.microsoft.com/net
Merge Hashset object and List object in C#
The following example demonstrates the use of the UnionWith method for merging a HashSet object and List object. Suppose objHash and objList are hashset and list objects of the int type respectively then you can merge objHash object to the objList like as: Continue reading “Merge Hashset
Can i contain duplicate values in Hashset object?
A HashSet object contains the non duplicate values or You can say the HashSet object is the collection of the objects that contains no duplicate elements, and whose elements are in no particular order. I can not add the item that is already exist in the HashSet object. Continue reading “Can i contain duplicate values in Hashset
How to create and extract a zip archive by using the ZipFile class in C#
The following code snippet shows how to create a zip file of the folder by using ZipFile Class in c#. In .Net framework 4.5, C# includes a new class in System.IO.Compression.FileSystem. However before 4.5 we have been using GZipStream Class that Provides methods and properties used to compress and decompress streams. Continue reading “How to create and extract a zip archive by using the ZipFile class in C#”