Click here to Skip to main content
15,891,905 members
Home / Discussions / C#
   

C#

 
GeneralRe: Weird C# String Behavior Pin
Judah Gabriel Himango6-Feb-06 5:18
sponsorJudah Gabriel Himango6-Feb-06 5:18 
GeneralRe: Weird C# String Behavior Pin
malharone6-Feb-06 5:29
malharone6-Feb-06 5:29 
GeneralRe: Weird C# String Behavior Pin
Judah Gabriel Himango6-Feb-06 7:15
sponsorJudah Gabriel Himango6-Feb-06 7:15 
AnswerRe: Weird C# String Behavior Pin
leppie6-Feb-06 5:16
leppie6-Feb-06 5:16 
GeneralRe: Weird C# String Behavior Pin
malharone6-Feb-06 5:36
malharone6-Feb-06 5:36 
AnswerRe: Weird C# String Behavior Pin
Nish Nishant6-Feb-06 6:06
sitebuilderNish Nishant6-Feb-06 6:06 
GeneralRe: Weird C# String Behavior Pin
malharone6-Feb-06 6:20
malharone6-Feb-06 6:20 
GeneralRe: Weird C# String Behavior Pin
Daniel Grunwald6-Feb-06 6:55
Daniel Grunwald6-Feb-06 6:55 
You can clone a string to get a different instance with the same value.
Or if you use Substring, you will also get a different instance of the same string:
object.ReferenceEquals("Hello", "Hello World".Substring(0,5)) will return false!

Why is this frustrating? The runtime creates interned string instances when the method is JITted. This is much faster than creating the string instance everytime the method in run. If you want a new string instance every time, well, then you still can use Clone().
GeneralNoooo! Pin
leppie6-Feb-06 7:49
leppie6-Feb-06 7:49 
QuestionWierdness trying to use a class library in a service Pin
ByStorm Software6-Feb-06 4:22
ByStorm Software6-Feb-06 4:22 
AnswerRe: Wierdness trying to use a class library in a service Pin
Joe Woodbury6-Feb-06 4:54
professionalJoe Woodbury6-Feb-06 4:54 
AnswerRe: Wierdness trying to use a class library in a service Pin
leppie6-Feb-06 7:57
leppie6-Feb-06 7:57 
GeneralRe: Wierdness trying to use a class library in a service Pin
ByStorm Software6-Feb-06 9:48
ByStorm Software6-Feb-06 9:48 
QuestionXsltArgumentList doesn't accept long parameter values Pin
mikko laanti6-Feb-06 4:21
mikko laanti6-Feb-06 4:21 
AnswerRe: XsltArgumentList doesn't accept long parameter values Pin
leppie6-Feb-06 5:21
leppie6-Feb-06 5:21 
QuestionAdd to favourites Pin
Brendan Vogt6-Feb-06 3:51
Brendan Vogt6-Feb-06 3:51 
Questionstatus bar Pin
Kola Sokol6-Feb-06 3:41
Kola Sokol6-Feb-06 3:41 
AnswerRe: status bar Pin
Ravi Bhavnani6-Feb-06 4:04
professionalRavi Bhavnani6-Feb-06 4:04 
GeneralRe: status bar Pin
Kola Sokol6-Feb-06 5:06
Kola Sokol6-Feb-06 5:06 
Questionmemcopy in C# ? Pin
smoitry6-Feb-06 3:28
smoitry6-Feb-06 3:28 
AnswerRe: memcopy in C# ? Pin
Judah Gabriel Himango6-Feb-06 4:58
sponsorJudah Gabriel Himango6-Feb-06 4:58 
QuestionHelp with multiview control needed!! Pin
BenPage6-Feb-06 2:07
BenPage6-Feb-06 2:07 
Questionbit + sq Pin
ita_cas6-Feb-06 1:48
ita_cas6-Feb-06 1:48 
AnswerRe: bit + sq Pin
albCode6-Feb-06 2:01
albCode6-Feb-06 2:01 
Questioncombo box, datagrid problem Pin
steve1_rm20006-Feb-06 1:31
steve1_rm20006-Feb-06 1:31 

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.