Counting words in a string in C#
It’s been a while since I’ve done a programming post, but something came up the other day that I thought might be useful. In one of my current projects, I needed to determine the number of words in a string. …
It’s been a while since I’ve done a programming post, but something came up the other day that I thought might be useful. In one of my current projects, I needed to determine the number of words in a string. …
It is very common with threaded applications to need to share data between threads, often in the form of dictionaries, lists, stacks, etc. However, the standard containers (generic or otherwise) in .NET are not thread-safeāif you just, say, reference a …
Thread-safe generic collections, containers and dictionaries in .NET Read more »
In a previous post, I demonstrated a convenient way to make a wait cursor show up during “reasonably” long operations (up to a few seconds). For anything longer than that, though, a wait cursor won’t cut it — for one …
Handling long operations with cancel and progress in C# with async Read more »
I actually did a post around this topic a while ago on another site that is now defunct, but I figured it is still useful, and I have a few additional details to add. Back in the C++/MFC days, there …
With the recent release of C# 6.0, I thought it would be good to provide a brief explanation of the new features of the language. I’ve done them as individual posts: Null-conditional operators Auto-property initializers using static Expression bodies on …
This is one of a series of posts on some of the new features in C# 6.0, which was just released. When Linq was added, a number of cool side-features ended up being added as well–these were things that were …
This is one of a series of posts on some of the new features in C# 6.0, which was just released. In C# there is a very handy expression – typeof – that returns the Type of an object. For …
This is one of a series of posts on some of the new features in C# 6.0, which was just released. The ability to format strings in .NET is straightforward, and fairly powerful (ignore the line breaks): string value = …
This is one of a series of posts on some of the new features in C# 6.0, which was just released. When catching exceptions in code, you can have a different catch block for different types of exceptions: try { …
This is one of a series of posts on some of the new features in C# 6.0, which was just released. Expression bodies let you use lambda-style expression declarations for methods and properties. So, instead of: public int Add(int x, …