Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

String.Trim not working

string

  • Please log in to reply
2 replies to this topic

#1 dirkfirst

dirkfirst

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 351 posts

Posted 19 July 2006 - 02:26 PM

When I do

String.Trim("\r\n");

it does nothing even though the intellisense claims it will remove all occurances of whitespace.
  • 0

#2 Crane

Crane

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 388 posts

Posted 22 July 2006 - 11:28 AM

You have to do

String myString = String.Trim("\r\n");

The value only gets assigned back.
  • 0

#3 hoser2001

hoser2001

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 170 posts

Posted 24 July 2006 - 05:33 AM

you mean:

String myString = "abunchacrap";
myString = myString.Trim("\r\n")

  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download