Nimble Coder

Adventures in Nimble Coding
posts - 76, comments - 39, trackbacks - 0

strings

There are 1 entries for the tag strings
Efficient String Blocks

One of the things that bothers me a lot is using a lot of string concatenation when you can just use the verbatim string literal (@"") to define a large block of text. For example, I saw some code on a blog the other day that looked something like this:string strValue = "<div id='test'>"; strValue += "<input type='text' id='name' value='" + strName + "/>"; strValue += "<input type='submit' />"; strValue += "</div>"; // Many more lines before it finally // finished building the string There are many things wrong with the code sample above including not using StringBuilder. I have seen the same type of code...

posted @ Friday, November 09, 2007 3:18 PM | Feedback (0) | Filed Under [ C# ]

Powered by: