M
monu
hi
can u write me
Why string.Empty is better then ""
bye
can u write me
Why string.Empty is better then ""
bye
monu said:hi
can u write me
Why string.Empty is better then ""
Tim said:It is often argued that it more clearly exresses the intent of the coder. I
would usually agree with this.
Oliver Sturm said:Right, and it's theoretically more flexible/portable, because you don't
rely on the fact that "" is the empty string. Hard to come up with a
practical example here, but the String.Empty syntax simply introduces that
additional layer of abstraction. Personally, I like the fact that it's
there and I use it, although it doesn't really make any difference to the
workings of your code (yet?).
Tim Haughton said:You're right on the portability front, just like I use Environment.NewLine
instead of "\r\n".
Tim Haughton said:You're right on the portability front, just like I use Environment.NewLine
instead of "\r\n".
Lasse Vågsæther Karlsen said:<snip>
Also see:
http://blogs.msdn.com/brada/archive/2003/04/22/49997.aspx
Looking at the IL generated, there's a difference, but both strings will
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.