title: Non-generic function to get the default value of a system.type
body: <p>I will only know the type at runtime.</p>
  
  <pre><code>Public Shared Function DefaultValue(Type As System.Type) As Object
    '???
  End Function
  </code></pre>
  
  <p>Can anyone fill in the function? thank you!</p>
  
  <p>EDIT:
  After the answer and more discussion, I have learned you can just do:</p>
  
  <p><code>MyExpression = Nothing</code></p>
  
  <p>to determine if the expression contains the default value for its type. Having the shared function in my library might help me remember this about the language but otherwise the function is not necessary. Thanks to Dave for pointing this out.</p>