Calculating the length of a string is a very simple thing to do in most programming languages. It is an action that you will find yourself needing to perform very often. Be it for validation, reporting or comparisons, knowing how to find how many characters a piece of text has using code is incredibly useful.…
I have a bit of an awkward example but I am trying to extract a value from a dictionary if the key contains a substring. I have this part working, but I need to know when it does not find a match. The response from this request does not seem to accept a null. Here…
I have a numeric string that contains leading zeros that I want to remove before I perform any comparisons with it on other objects. How can I trim an undefined number of zeros from a string without having to loop through the characters in the string and remove all the zeros that come first?
I want to try and add some override code that will perform a specific action if the user making the request is using a particular user agent. I have the two following methods that are overridden from the base ActionFilterAttribute  class. [crayon-5e4f7cf1bc32e957857843/] I have seen other tutorials where people are able to access properties of…
Is there a way to check if an Expando object contains a property before interacting with it. For example, If i were to say [crayon-5e4f7cf1bc68d688733073-i/] and Something didn't exist, it will throw an exception. How do i check to see if "Something" exists in the expando object before I query it?
Quite often when dealing with an API or some other external service, you will find that you get Unix timestamps returned to you or alternatively have to provide a timestamp in Unix form when sending a request back. Since you are going to be running your .NET code on a windows machine, you don't have…
  I recently hit an issue where i needed to change the name of an XML node. It ended up being a lot more complicated than I had expected it to be. node.Name is a read only field, so you can't take the simple route and rename it this way. Since you cannot rename the…
This tutorial will show you how to programmatically create a subsite in Sharepoint. This can be done a few different ways and if you have server access you may prefer to do this on the server side, but you can just as easily create one using the Client-Side Object Model. You can do this using a standard…
This can be done in the RouteConfig.cs. You can set the default route that will be used to display the home page. You can find this file in Project->App_Start->RouteConfig.cs. The config inside this file will let you set default home page for ASP.NET razor MVC websites. The contents of the default file should look something…