title: How to make a user defined function such as (int).function() in c#?
body: <p>In C#, when I enclose an int value in brackets and type the dot, I get a list of functions that can be performed on that int value</p>
  
  <pre><code>string a = (12).ToString();
  </code></pre>
  
  <p>My question is, <strong>how can we define a custom function like that?</strong> For example I want to define a function toDateTime which can work like this</p>
  
  <pre><code>DateTime dt = ("12/12/12").toDateTime();
  </code></pre>
  
  <p>I fully understand that this can be done by the normal way also</p>
  
  <pre><code>DateTime dt = toDateTime("12/12/12");
  </code></pre>
  
  <p>I am just curious about how it is done by the other way.</p>