title: How to use output parameter with StringBuilder?
body: <p>I pass a stringbuild out variable to function which parameter type is out stringbuild, but compiler tel me</p>
  
  <p>"Before leave function, You must assign value to sbValue"</p>
  
  <pre><code>    public void FuncOutParamString(out StringBuilder sbValue)
      {
          sbValue.Append("wold!");
      }
  
      private void btnOutParam_Click(object sender, RoutedEventArgs e)
      {
          Console.WriteLine("=================== Out Parameter ===================");
          // Declare a variable but don't assign a value to it ******************************
          int y = 0;
  
          // Pass it in as an output parameter, even though its value is unassigned
          FuncOutParamInt(out y);
  
          // It's now assigned a value, so we can write it out:
          Console.WriteLine(y);
  
          // Declare a variable but don't assign a value to it ******************************
          StringBuilder sb = new StringBuilder();
          sb.Append("Hello ");
          FuncOutParamString(out sb);
  
          Console.WriteLine(sb);
      }
  </code></pre>
  
  <p>Sorry, I need 10 reputation to post image</p>