title: vb.net syntax using stringbuilder in function
body: <p>What is the correct code syntax (Set the StringBuilder instance to Nothing at the end the function) when use stringbuilder in a function that return a string?
  Usually i try to use the statement 'using', but StringBuilder don't implement iDisposable.</p>
  
  <p>To be more precise: i want to release the memory occupied from the StringBuilder instance when GC will run, so i'd like to set the StringBuilder instance to Nothing at the end of the Function.</p>
  
  <p>Please do someone know 'where' should i set the StringBuilder instance to Nothing?</p>
  
  <p>Here's the code.</p>
  
  <pre><code>Function GetString() As String
      Try()
          Dim sb As New StringBuilder
          sb.AppendLine("my first line")
          Return sb.ToString()
          'Should i put here 'sb = Nothing' ?
      Catch()
          Return Nothing
      End Try()
  End Function
  </code></pre>
  
  <p>Or it's better this solution?</p>
  
  <pre><code>Function GetString() As String
      Dim sb As New StringBuilder
      Try()
          sb.AppendLine("my first line")
          Return sb.ToString()
      Catch()
          Return Nothing
      End Try()
      'Or should i put here 'sb = Nothing' ?
  End Function
  </code></pre>