http://msdn2.microsoft.com/en-us/library/t97s7bs3.aspx
Pretty straight forward: String myString = " Testing Testing 123 "; Console.WriteLine(myString.Trim()); This will produce "Testing Testing 123" (notice the lack of spaces before and after the string contents). There is also TrimEnd() and TrimStart(). Also don't forget that strings are immutable in C# so everytime you call Trim() on a string you will get a new one back and the original will be unmodified. -Pete On Thu, Apr 10, 2008 at 7:14 PM, Tracy Ding <[EMAIL PROTECTED]> wrote: > > Can anyone tell me how to use string function Trim in C#? > > > Sincerely, > > Tracy Ding > XYPRO Technology > USA HQ phone: +1-805-583-2874 > > > =================================== > This list is hosted by DevelopMentor(R) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com