Click here to Skip to main content
15,911,503 members
Home / Discussions / C#
   

C#

 
AnswerRe: Drawing Windows window Pin
Paulo Zemek25-Nov-09 8:03
Paulo Zemek25-Nov-09 8:03 
GeneralRe: Drawing Windows window Pin
cdpace25-Nov-09 10:31
cdpace25-Nov-09 10:31 
GeneralRe: Drawing Windows window Pin
Paulo Zemek25-Nov-09 11:14
Paulo Zemek25-Nov-09 11:14 
QuestionVS integrated designer Pin
careylin25-Nov-09 5:01
careylin25-Nov-09 5:01 
AnswerRe: VS integrated designer Pin
avigodse26-Nov-09 19:11
professionalavigodse26-Nov-09 19:11 
Questionbenifit of string constructor Pin
Member 225007225-Nov-09 3:25
Member 225007225-Nov-09 3:25 
AnswerRe: benifit of string constructor Pin
dan!sh 25-Nov-09 3:26
professional dan!sh 25-Nov-09 3:26 
AnswerRe: benifit of string constructor Pin
Simon P Stevens25-Nov-09 4:19
Simon P Stevens25-Nov-09 4:19 
No, in fact it's worse.

Strings are immutable. This means once they are created they can't be changed.

The first line creates an empty string.

The second line creates a new string from your two literals, and assigns the variable to this new string.

If you're very lucky, the compiler might optimise the extra creation out as it's not used, but even then your left back where you started with just 1 creation.

Just do it the normal way.
String myString = "test";


Simon

AnswerRe: benifit of string constructor Pin
Shameel25-Nov-09 4:47
professionalShameel25-Nov-09 4:47 
AnswerRe: benifit of string constructor Pin
OriginalGriff25-Nov-09 5:34
mveOriginalGriff25-Nov-09 5:34 
AnswerRe: benifit of string constructor Pin
PIEBALDconsult25-Nov-09 12:17
mvePIEBALDconsult25-Nov-09 12:17 
QuestionA network-related or instance-specific error Pin
Jassim Rahma25-Nov-09 3:21
Jassim Rahma25-Nov-09 3:21 
AnswerRe: A network-related or instance-specific error Pin
Jassim Rahma25-Nov-09 3:38
Jassim Rahma25-Nov-09 3:38 
Questionserver application capturing audio from Skype Pin
johnyjj225-Nov-09 2:53
johnyjj225-Nov-09 2:53 
QuestionControl relocated if changing fontsize in designer Pin
rpm820025-Nov-09 2:08
rpm820025-Nov-09 2:08 
AnswerRe: Control relocated if changing fontsize in designer Pin
Gerry Schmitz25-Nov-09 3:05
mveGerry Schmitz25-Nov-09 3:05 
GeneralRe: Control relocated if changing fontsize in designer [modified] Pin
rpm820025-Nov-09 3:09
rpm820025-Nov-09 3:09 
QuestionRFID Pin
J imran25-Nov-09 2:06
J imran25-Nov-09 2:06 
AnswerRe: RFID Pin
harold aptroot25-Nov-09 2:18
harold aptroot25-Nov-09 2:18 
GeneralRe: RFID Pin
Nagy Vilmos25-Nov-09 3:39
professionalNagy Vilmos25-Nov-09 3:39 
GeneralRe: RFID Pin
harold aptroot25-Nov-09 4:01
harold aptroot25-Nov-09 4:01 
GeneralRe: RFID Pin
Luc Pattyn25-Nov-09 4:46
sitebuilderLuc Pattyn25-Nov-09 4:46 
GeneralRe: RFID Pin
OriginalGriff25-Nov-09 5:38
mveOriginalGriff25-Nov-09 5:38 
GeneralRe: RFID Pin
harold aptroot25-Nov-09 5:45
harold aptroot25-Nov-09 5:45 
GeneralRe: RFID Pin
J imran25-Nov-09 7:17
J imran25-Nov-09 7: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.