[.net] changing a character in a C# string

Started by
18 comments, last by Washu 12 years, 9 months ago
Advertisement
You are misrespresenting the conversation. Read it again, carefully. You'll find SiCrane is the first individual who points out the immutability of strings:

In .NET strings are immutable. You need to create a new string with the contents that you want. This can be done with dumping the string in a char array and modifying that, using a StringBuilder, using sub string and concatenation operations, etc.
[/quote]
You'll also note that among the solutions he lists "sub string and concatenation operations, etc", which basically means "using the interface of string".

Your later post:

Dude, way too deep here. Strings are immutable but the CLR takes care of all that stuff in the background. Unless you've got a thousand page book stored in a string and are duplicating said string several times you won't really notice anything performance wise.
[/quote]
This is ambiguous. At the time the "in the background" comment seemed to be aimed at the immutability of strings. It is now apparent that your comment was aimed at SiCrane's suggestions of char arrays and StringBuilder.

So we had a little miscommunication, no biggie. The thread degenerates from their, mostly due to your belligerent attitude. You continue to drag the tone of the thread around this, for no real reason.

This topic is closed to new replies.

Advertisement