Tag Archives: CompareTo

Efficiently see if a string is blank in C#

This example uses three strings to compare different methods for determining whether a string is blank. One of the methods, the string class’s IsNullOrWhiteSpace method, only works in .NET Framework 4.5 or later, so this example targets that version of … Continue reading

Posted in performance, strings | Tagged , , , , , , , , , , , , , , | 5 Comments

Sort objects in C#

This example shows how you can easily sort objects in C#. Sorting algorithms are absolutely fascinating and I recommend that everyone study them at some point. Different algorithms demonstrate interesting and useful techniques such as recursion, divide-and-conquer, linked data structures, … Continue reading

Posted in algorithms | Tagged , , , , , , , , , , , , , , | Leave a comment