Click here to Skip to main content
16,007,277 members
Home / Discussions / C#
   

C#

 
GeneralRe: serial communication in c# Pin
Heath Stewart20-Apr-04 8:37
protectorHeath Stewart20-Apr-04 8:37 
GeneralRe: serial communication in c# Pin
Marc Clifton20-Apr-04 13:37
mvaMarc Clifton20-Apr-04 13:37 
GeneralSmall string building question Pin
Le centriste20-Apr-04 6:26
Le centriste20-Apr-04 6:26 
GeneralRe: Small string building question Pin
Jeremy Kimball20-Apr-04 6:37
Jeremy Kimball20-Apr-04 6:37 
GeneralRe: Small string building question Pin
Mike Dimmick20-Apr-04 6:45
Mike Dimmick20-Apr-04 6:45 
GeneralRe: Small string building question Pin
Heath Stewart20-Apr-04 8:33
protectorHeath Stewart20-Apr-04 8:33 
GeneralRe: Small string building question Pin
Jeff Varszegi20-Apr-04 9:33
professionalJeff Varszegi20-Apr-04 9:33 
GeneralRe: Small string building question Pin
Mike Dimmick20-Apr-04 6:42
Mike Dimmick20-Apr-04 6:42 
The Format version is more costly in performance. However, it is vastly more flexible; you can position the item to be replaced anywhere in the string. You can even place formats in a different order to the order they're passed to Format, or use the same replacement multiple times. This makes it easier to localize displays for different cultures.

Multiple string concatenations with + in the source code are compiled to calls to String.Concat by the C# compiler, and so don't cause any extra overhead in terms of memory usage.

I'd use Format for any strings presented to a user and which therefore might be localized, and + for any internal string operations.

See also Rico Mariani's blog[^] (a performance architect on the .NET Framework team at Microsoft).

Stability. What an interesting concept. -- Chris Maunder
GeneralRe: Small string building question Pin
Jeff Varszegi20-Apr-04 6:58
professionalJeff Varszegi20-Apr-04 6:58 
GeneralRe: Small string building question Pin
Jeff Varszegi20-Apr-04 6:56
professionalJeff Varszegi20-Apr-04 6:56 
GeneralRe: Small string building question Pin
Le centriste20-Apr-04 8:30
Le centriste20-Apr-04 8:30 
GeneralRe: Small string building question Pin
Jeff Varszegi20-Apr-04 9:50
professionalJeff Varszegi20-Apr-04 9:50 
GeneralRe: Small string building question Pin
Heath Stewart20-Apr-04 8:36
protectorHeath Stewart20-Apr-04 8:36 
GeneralRe: Small string building question Pin
Jeff Varszegi20-Apr-04 9:22
professionalJeff Varszegi20-Apr-04 9:22 
GeneralRe: Small string building question Pin
Heath Stewart20-Apr-04 9:26
protectorHeath Stewart20-Apr-04 9:26 
GeneralRe: Small string building question Pin
Jeff Varszegi20-Apr-04 9:36
professionalJeff Varszegi20-Apr-04 9:36 
GeneralRe: Small string building question Pin
Jeff Varszegi20-Apr-04 9:41
professionalJeff Varszegi20-Apr-04 9:41 
GeneralRe: Small string building question Pin
Heath Stewart20-Apr-04 9:51
protectorHeath Stewart20-Apr-04 9:51 
GeneralRe: Small string building question Pin
Jeff Varszegi20-Apr-04 10:02
professionalJeff Varszegi20-Apr-04 10:02 
GeneralRe: Small string building question Pin
Jeff Varszegi20-Apr-04 9:48
professionalJeff Varszegi20-Apr-04 9:48 
GeneralRemoving plus on root node of a TreeView Pin
Matt Daley20-Apr-04 6:15
Matt Daley20-Apr-04 6:15 
GeneralRe: Removing plus on root node of a TreeView Pin
Mike Dimmick20-Apr-04 6:49
Mike Dimmick20-Apr-04 6:49 
GeneralRe: Removing plus on root node of a TreeView Pin
Matt Daley20-Apr-04 7:18
Matt Daley20-Apr-04 7:18 
QuestionInformation about doing a bandwidth monitor? Pin
Marlun20-Apr-04 4:10
Marlun20-Apr-04 4:10 
AnswerRe: Information about doing a bandwidth monitor? Pin
leppie20-Apr-04 6:54
leppie20-Apr-04 6:54 

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.