Jump to content

String.Trim not working

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
dirkfirst

dirkfirst

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 354 posts
When I do


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


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

#2
Crane

Crane

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 398 posts
You have to do


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


The value only gets assigned back.

#3
hoser2001

hoser2001

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
you mean:

 

String myString = "abunchacrap";

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