Compulsory Cow – F/OSS lib for safer string.Format(…) calls

I recently released some Dotnet open source functionality for doing safer string formatting.

Think like this:
When formatting strings in Dotnet C#/Vbnet string.Format is handy. But it always carries the risk of failing runtime when the format string is incorrect.
When you are doing (error) logging with strings (in a file) you want the logging to proceed without failing. Ever.

SafeFormat(…) or it’s extension variant “…”.SFormat(…) does just this. It formats exactly as string.Format does (it uses string.Format internally) but in case of a wrongly formatted format string it doesn’t throw an exception but instead does as good as it can and outputs the data it can gather together with a comment that something is broken.

Get all the shiny here:


Leave a Reply