Limits of Trim( )

Results 1 to 3 of 3

Thread: Limits of Trim( )

  1. #1
    Join Date
    Dec 1969

    Default Limits of Trim( )

    I want to trim all whitespace from a string, including stray line and paragraph breaks at the end...<BR><BR>Does Trim() do that? If not, any ideas how?<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Limits of Trim( )

    TRIM() removes leading a trqailing spaces only.<BR><BR>To remove Carriage Return/Line feed then use Replace()<BR><BR>eg<BR>replace({string},vbCrLf,"") <BR><BR>for other non printable characters you can also use replace<BR>eg<BR>replace({string},Chr({ASCII dec value}),"") <BR><BR>So the prev example to remove CR/LF could also be done by<BR>replace({string},Chr(13)&Chr(10), "")

  3. #3
    Join Date
    Dec 1969

    Default Probably better to use a regexp

    &#060;%<BR>Set re = New RegExp<BR>re.Pattern = "[s]*"<BR>re.Global<BR>text = re.Replace( text, "" )<BR>%&#062;<BR><BR>That will take care of new lines, tabs, vertical tabs, spaces, you name it.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts