Click here to Skip to main content
14,643,058 members
Home » Discussions » C#
   

C#

 
AnswerRe: design of a commercial site Pin
Eddy Vluggen17-Apr-12 6:31
professionalEddy Vluggen17-Apr-12 6:31 
AnswerRe: design of a commercial site Pin
Abhinav S17-Apr-12 7:03
MemberAbhinav S17-Apr-12 7:03 
QuestionHow to send hashtable parameter in restful client Pin
NarVish17-Apr-12 3:56
MemberNarVish17-Apr-12 3:56 
Questioncrystal report can be sent vai e-mail as a body Pin
narendra ingale16-Apr-12 23:54
Membernarendra ingale16-Apr-12 23:54 
AnswerRe: crystal report can be sent vai e-mail as a body Pin
V.17-Apr-12 0:53
professionalV.17-Apr-12 0:53 
QuestionStringbuilder Pin
jeramyRR16-Apr-12 19:24
MemberjeramyRR16-Apr-12 19:24 
AnswerRe: Stringbuilder Pin
egenis16-Apr-12 19:34
Memberegenis16-Apr-12 19:34 
AnswerRe: Stringbuilder Pin
VJ Reddy16-Apr-12 19:38
MemberVJ Reddy16-Apr-12 19:38 
In .NET, string class is immutable. Simply put, it means that you cannot modify a string after it's creation. So, for example
string someString = "Hello";
//Now if we write
someString += " World";
The program will not add World to the existing string. Instead, it will create a new string object "Hello World" and assigns this to someString and discards the earlier object "Hello". So, this may not be a big issue if we are dealing with only a few strings. But, if we want to deal with several string operations, then StringBuilder is a good option. As explained here http://msdn.microsoft.com/en-us/library/y9sxk6fy.aspx[^]

This class represents a string-like object whose value is a mutable sequence of characters. The value is said to be mutable because it can be modified once it has been created by appending, removing, replacing, or inserting characters.
And after making all the modifications ToString method of StringBuilder can be used to get the final string.
I think this Code Project article
StringBuilder vs. String, Fast String Operations with .NET 2.0[^]
may be helpful.

modified 17-Apr-12 11:46am.

GeneralRe: Stringbuilder Pin
jeramyRR16-Apr-12 20:00
MemberjeramyRR16-Apr-12 20:00 
AnswerRe: Stringbuilder Pin
Abhinav S16-Apr-12 19:50
MemberAbhinav S16-Apr-12 19:50 
GeneralRe: Stringbuilder Pin
VJ Reddy16-Apr-12 19:58
MemberVJ Reddy16-Apr-12 19:58 
GeneralRe: Stringbuilder Pin
Anurag Sarkar16-Apr-12 19:59
MemberAnurag Sarkar16-Apr-12 19:59 
AnswerRe: Stringbuilder Pin
Keith Barrow16-Apr-12 23:00
professionalKeith Barrow16-Apr-12 23:00 
GeneralRe: Stringbuilder Pin
VJ Reddy16-Apr-12 23:31
MemberVJ Reddy16-Apr-12 23:31 
QuestionProgramatically add digital signature to a document uploaded in Sharepoint library Pin
NishaTM16-Apr-12 16:48
MemberNishaTM16-Apr-12 16:48 
QuestionOptimising XML Pin
si_6916-Apr-12 8:01
Membersi_6916-Apr-12 8:01 
AnswerRe: Optimising XML Pin
PIEBALDconsult16-Apr-12 11:05
professionalPIEBALDconsult16-Apr-12 11:05 
SuggestionRe: Optimising XML Pin
RobCroll16-Apr-12 18:10
MemberRobCroll16-Apr-12 18:10 
QuestionError in loading excel file in windows 7 ... Pin
nassimnastaran16-Apr-12 5:34
Membernassimnastaran16-Apr-12 5:34 
AnswerRe: Error in loading excel file in windows 7 ... Pin
Pete O'Hanlon16-Apr-12 5:41
subeditorPete O'Hanlon16-Apr-12 5:41 
GeneralRe: Error in loading excel file in windows 7 ... Pin
nassimnastaran16-Apr-12 6:47
Membernassimnastaran16-Apr-12 6:47 
AnswerRe: Error in loading excel file in windows 7 ... Pin
Wes Aday16-Apr-12 7:01
professionalWes Aday16-Apr-12 7:01 
GeneralRe: Error in loading excel file in windows 7 ... Pin
nassimnastaran16-Apr-12 7:32
Membernassimnastaran16-Apr-12 7:32 
GeneralRe: Error in loading excel file in windows 7 ... Pin
Wes Aday16-Apr-12 9:02
professionalWes Aday16-Apr-12 9:02 
AnswerRe: Error in loading excel file in windows 7 ... Pin
Eddy Vluggen16-Apr-12 8:28
professionalEddy Vluggen16-Apr-12 8:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.