Thank You for the reply.
My question now is how many bytes are allocated with the following:
string name; <--how many here
as opposed to
string name = new String(' ',20); I'm assuming 20 bytes and 1 for the
null
Is it 255 bytes or not determined until there is an assignment with either
readline or direct assignment?
Thank You!
"Bob Grommes" <bo*@bobgrommes.com> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
System.String has constructors. It's just syntax sugar that you don't
generally have to new us a String directly. It is done implicitly for you
as a convenience.
Actually the only time I've ever used the String constructor directly is
to create a string preloaded with a number of characters:
string strTwentySpaces = new String(' ',20);
--Bob
"Jay" <j@h.com> wrote in message news:j5JCc.21067$wS2.16552@okepread03... Why is it some things require new and some do not?
System.String name;
System.Random r = new Random