Re: Empty string



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 ***


.