Replace Function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tugsy
    New Member
    • Dec 2006
    • 1

    Replace Function

    Hi,

    How do I use the replace function to replace 2 different parts in a DB.

    Dim id,newsitem,new sbody,dt,create dby
    id = request("id")
    newsitem = replace(request ("newsitem") , "'", "''")
    newsbody = replace(request ("newsbody") , "'", "''")
    dt = now()
    createdby = request("update by")

    What I need in the 'newsbody' is to replace the ,vbCrLf , <BR> as well as the "'", "''"

    or can I add it to the response.write at the viewing end?

    Can any one help?

    Thanks.
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    You can replace only one string at a time with Replace .So give different statements for each one of them.

    if instr('newsbody ' ,vbcrlf)>0 then replace('newsbo dy',vbcrlf,"") etc.

    Is it that you want?

    Comment

    Working...