Maha

Maha

  • NA
  • 0
  • 328.5k

NP131 StringBuilder/character type

Aug 23 2008 8:57 AM

Hi Guys

 

NP131 StringBuilder/character type

 

This program is producing following result when β€˜1’ in the Append() method is a character type (highlighted in yellow).

Please explain the reason.

 

myStringzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

  

Thank you

 

using System;

using System.Text;

 

class MainClass

{

    public static void Main()

    {

        StringBuilder myStringBuilder = new StringBuilder();

 

        myStringBuilder.Append("myString");

 

        myStringBuilder.Append('z', '1');

 

        Console.WriteLine(myStringBuilder);

    }

}


Answers (2)