Re: Empty string
- From: "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@xxxxxxx>
- Date: Mon, 18 Jul 2005 13:38:03 -0500
M D,
| Or if there were a way to create a new empty string
| object.
Have you tried:
String empty = new String('\0', 0)
Which creates a new empty string object.
Hope this helps
Jay
"M D" <mardukes@xxxxxxx> wrote in message
news:%234U2GN8iFHA.1044@xxxxxxxxxxxxxxxxxxxxxxx
|I think you guys have missed the point.
|
| What I had to do was create a string field at object level and
| initialize it at the begining of each call to the recursion because ""
| cannot be passed by ref as it is not an lvalue (as I suggested, it is on
| the stack not the heap.) This is what I was trying to avoid as it is
| poor form in object orientation where I should be able to create a new
| String(), leave it nameless and under the perview of the garbage
| collector once the recursion is complete.
|
| I wouldn't have had this problem if I were creating, say, a new
| StreamWriter. Or if there were a way to create a new empty string
| object.
|
| String.Copy("") is also not an lvalue.
|
| thx
| md
|
| *** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: Empty string
- From: Jon Skeet [C# MVP]
- Re: Empty string
- References:
- Re: Empty string
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Empty string
- From: M D
- Re: Empty string
- Prev by Date: Re: conditional hyperlink in datagrid
- Next by Date: Datagrid, ArrayList, and columns
- Previous by thread: Re: Empty string
- Next by thread: Re: Empty string
- Index(es):