replace char() HELP !!!

Results 1 to 2 of 2

Thread: replace char() HELP !!!

  1. #1
    Join Date
    Dec 1969
    Posts
    34

    Default replace char() HELP !!!

    I am trying to make the format of a textarea the same when it is read from an access db and displayed as it was when it was input (with line breaks)<BR>I have had the suggestion of doing <BR><BR>textarea1=Request(textarea1)<BR><BR>if textarea1&#060;&#062;"" Then<BR> response.write replace(textarea1,char(10),"&#060;p&#062;")<BR>end if<BR><BR><BR>but it gives me a type mismatch ? if anyone knows how to get this going tell me because im cracking up !!<BR>

  2. #2
    ning Guest

    Default RE: replace char() HELP !!!

    first of all, you use the wrong name of the function,<BR>it is CHR(), not CHAR()<BR>second, try this:<BR>if textarea1&#060;&#062;"" Then<BR> textline = replace(textarea1,chr(10),"&#060;p&#062;")<BR>resp onse.write(textline) <BR><BR>end if<BR><BR>P.S. if your original text is from Word(*.doc) file, the return character might not be chr(10), but some other character. I have problem using CHR() function with word files, the characters like TAB, apostrophe, and extension dots like ..., won&#039t be replaced by the REPLACE() function.<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
  •