Click here to Skip to main content
15,909,091 members
Home / Discussions / C#
   

C#

 
AnswerRe: DataGridView - Adding new row Pin
MoustafaS16-Feb-07 10:33
MoustafaS16-Feb-07 10:33 
GeneralRe: DataGridView - Adding new row Pin
Aleksandar Smudja16-Feb-07 11:17
Aleksandar Smudja16-Feb-07 11:17 
QuestionChild MDI problem with Events [modified] Pin
ross.anderson16-Feb-07 9:07
ross.anderson16-Feb-07 9:07 
QuestionStringBuilder vs. String Pin
yesufollower16-Feb-07 6:12
yesufollower16-Feb-07 6:12 
AnswerRe: StringBuilder vs. String Pin
Thomas Stockwell16-Feb-07 6:16
professionalThomas Stockwell16-Feb-07 6:16 
AnswerRe: StringBuilder vs. String Pin
tgrt16-Feb-07 7:05
tgrt16-Feb-07 7:05 
AnswerRe: StringBuilder vs. String Pin
Marcus J. Smith16-Feb-07 8:27
professionalMarcus J. Smith16-Feb-07 8:27 
AnswerRe: StringBuilder vs. String Pin
Luc Pattyn16-Feb-07 9:39
sitebuilderLuc Pattyn16-Feb-07 9:39 
Hi,

StringBuilder will show much better performance than string when you need to calculate complex string expressions as in:

string s="the alphabet consists of ";
foreach (char c in "abc...z") s=s+c;


Inside the loop each s=s+c; will create a new string, copy the existing characters and append
one (that is a quadratic operation: when the number of iterations doubles, the cost
will quadruple).
With StringBuilder nothing gets copied as long as the StringBuilder's capacity is
sufficient. So I would say if there are fewer than 3 to 5 operations, string will be faster;
in my example StringBuilder will win hands down; and yes it helps to give it adequate
initial capacity.

Smile | :)


Luc Pattyn

AnswerRe: StringBuilder vs. String Pin
Vega0216-Feb-07 20:54
Vega0216-Feb-07 20:54 
QuestionCompressing a jpg file Pin
GazzaJ16-Feb-07 4:05
GazzaJ16-Feb-07 4:05 
AnswerRe: Compressing a jpg file Pin
Russell Jones16-Feb-07 4:58
Russell Jones16-Feb-07 4:58 
GeneralRe: Compressing a jpg file Pin
GazzaJ19-Feb-07 1:41
GazzaJ19-Feb-07 1:41 
QuestionWindows Forms and XML Pin
parth_00716-Feb-07 3:25
parth_00716-Feb-07 3:25 
AnswerRe: Windows Forms and XML Pin
Colin Angus Mackay16-Feb-07 3:50
Colin Angus Mackay16-Feb-07 3:50 
GeneralRe: Windows Forms and XML Pin
parth_00716-Feb-07 4:16
parth_00716-Feb-07 4:16 
AnswerRe: Windows Forms and XML Pin
Pete O'Hanlon16-Feb-07 4:37
mvePete O'Hanlon16-Feb-07 4:37 
GeneralRe: Windows Forms and XML Pin
parth_00716-Feb-07 5:36
parth_00716-Feb-07 5:36 
GeneralRe: Windows Forms and XML Pin
Pete O'Hanlon16-Feb-07 9:57
mvePete O'Hanlon16-Feb-07 9:57 
GeneralRe: Windows Forms and XML Pin
parth_00716-Feb-07 10:00
parth_00716-Feb-07 10:00 
GeneralRe: Windows Forms and XML Pin
Pete O'Hanlon16-Feb-07 10:07
mvePete O'Hanlon16-Feb-07 10:07 
QuestionGraphics Clipping in C#.net Pin
free_soul42416-Feb-07 3:22
free_soul42416-Feb-07 3:22 
AnswerRe: Graphics Clipping in C#.net Pin
samreengr816-Feb-07 9:41
samreengr816-Feb-07 9:41 
GeneralRe: Graphics Clipping in C#.net Pin
free_soul42416-Feb-07 21:50
free_soul42416-Feb-07 21:50 
GeneralRe: Graphics Clipping in C#.net Pin
samreengr819-Feb-07 10:21
samreengr819-Feb-07 10:21 
Questioncall a vb function with out paramaters Pin
cmarmr16-Feb-07 3:17
cmarmr16-Feb-07 3:17 

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.