On Fri, Jun 24, 2011 at 5:00 AM, ankit m a cool dude with hot atitude <jainismru...@gmail.com> wrote: > Hi All, > > I am having a small problem regarding memory management in .NET. > > Suppose we declared and defined a string variable str="Today is a confusing > day" > Now we used this string in our code. After that we need to have some other > data in the str variable. So before assigning it some other string like > str="Now all the confusions are resolved" we need to dispose the memory held > by previously assigned string as strings are immutable. > > Please don't tell me about StringBuilder as I can not use it becoz I have to > do a lot of split,indexOf,lastindexof,Substring operations. ---------------
Are you changing the value of the string often in your process? String srt ="Start here"; str = "Change1"; if str=="Change1" str = Change2"; -- Stephen Russell Unified Health Services 60 Germantown Court Suite 220 Cordova, TN 38018 Telephone: 888.510.2667 901.246-0159 cell -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to dotnetdevelopment@googlegroups.com To unsubscribe from this group, send email to dotnetdevelopment+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net