I want to Remove Carrige Returns??????

Results 1 to 5 of 5

Thread: I want to Remove Carrige Returns??????

  1. #1
    JB Guest

    Default I want to Remove Carrige Returns??????

    Hi,<BR><BR>I have a html stripping function that works fine. However, I would like to take out the CR so that it leaves me with one big long single line text string.<BR><BR>What do I need to replace if I can even do it?<BR><BR>I already have this<BR><BR>regEx.Pattern = "&#060;[^&#062;]*&#062;"<BR>strTagLess = regEx.Replace(strTagLess, "")<BR><BR>regEx.Pattern = "*"<BR>strTagLess = regEx.Replace(strTagLess, "")<BR><BR><BR><BR>Any Help would be greatly appreciated. <BR><BR>Oh, In case your interested why, I am trying to set up a site indexing program that leaves nothing accept the text of an article with absolutly nothing else and returns it on one long single line. Than I can start taking out words like a,the,for, etc... so they don&#039;t get indexed.<BR><BR>Thanks,<BR><BR>JB<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: I want to Remove Carrige Returns??????

    You don&#039;t even need a RegExp to do this - you can do this in VBS:<BR><BR>strText = Replace(strInput, vbCRLF, "")<BR><BR>If you wan to use RegExps,
    matches a new line and
    matches a carriage return.<BR><BR>Dunc

  3. #3
    JB Guest

    Default RE: I found that this works best!

    HI Duncan,<BR><BR>After palying around using various methods I found the following works best for what I originally wanted. "One Long Text Line."<BR><BR>Here is the order I used:<BR><BR>regEx.Pattern = "& nbsp;"<BR>strTagLess = regEx.Replace(strTagLess, "")<BR><BR>regEx.Pattern = chr(32) + chr(32)<BR>strTagLess = regEx.Replace(strTagLess, "")<BR><BR>regEx.Pattern = chr(10)<BR>strTagLess = regEx.Replace(strTagLess, "")<BR><BR>regEx.Pattern = chr(13)<BR>strTagLess = regEx.Replace(strTagLess, "")<BR><BR>strTagLess = Trim(strTagLess) <BR><BR>I tried lots of different combinations of f h
    etc. with varying results. The only thing that really worked for me was the syntax listed above. It leaves a nice tight string.<BR><BR>Many Thanks,<BR><BR>JB<BR><BR>

  4. #4
    Join Date
    Dec 1969

    Default They make an HTML tag for this...

    If you just want one long never ending string, just enclose the string with &lt; nobr &gt; &lt;/ nobr &gt;

  5. #5
    Join Date
    Dec 1969

    Default RE: I want to Remove Carrige Returns??????

    Carriage return characters in text strings are made differently on Windows, Macintosh and Unix. <BR><BR>Windows:
    <BR><BR>A regular expression in JavaScript that removes these is:<BR><BR>str = str.replace(/[

Posting Permissions

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