TechBubbles

Archive for the '.NET Framework 4' Category

.NET Framework 4 File IO Features

New methods are added to the System.IO.File class in .NET framework 4.0 for reading and writing text files.

ReadLines

In earlier version we have used File.ReadAllLines method which returns a string array of all lines in the file.

String[] lines = File.ReadAllLines(“file.txt”);

Read more

Related Posts:

1 comment

.NET Framework 4 SortedSet

You can get the overview on what’s new in .NET FW BCL by reading my post .NET Framework 4 BCL. This post explains about one of the feature SortedSet. .NET Framework 4 adds a new collection to System.Collections.Generic, named  Sorted Set<T>.  It is like HashSet<T>  collection of unique elements, but SortedSet<T> keeps the elements in sorted order.

The Collection is implemented using red-black tree datastructure. Compared to HashSet<T> provides lesser performance for insert,delete and lookup operations. Use this collection if you want to keep the elements in sorted order.

Read more

Related Posts:

No comments