A simple C# JsonConverter example – bool to bit

Newtonsoft Json.NET is a great framework for serialising/de-serialising your Json with .Net, it has a good collection of default handlers for transforming data-types, but what if you would like to override the way in which a property is written/read.
In this example we will change the way that boolean properties are handled, so that they are read and written as 1 or 0 as opposed to the default “True” or “False”.

Continue reading

Splitting strings in MS Excel without regular expressions

Consider a fieldĀ in Excel that contains a number followed by a ‘\’ character, followed by 3 letters.

For example: 123456789\ABC

No let us say that you would like to get the part of the string that exists before or after the ‘\’ character into another field.

You could write a VBA script that uses regular expressions, but this can more easily be achieved using a combination of the RIGHT, LEFT, LEN and FIND methods. Continue reading