Help with Replace code

Results 1 to 2 of 2

Thread: Help with Replace code

  1. #1
    Mike Palmer Guest

    Default Help with Replace code

    Hello All, <BR><BR>Hope someone can help me. I am written the following:<BR><BR>iStart = 1<BR>iStop = 1<BR>Do Until iStart = 0<BR> response.write istart & "<BR>"<BR> iStart = instr(iStart+1,strRetval,"&#060;a href=""http://", 1)<BR>if Not iStart = 0 then<BR> strRetval=Replace(strRetval, "&#062;", " Target=&#039_blank&#039&#062;", iStart, 1, 1)<BR> response.write strRetval<BR>end if<BR>Loop<BR><BR>What I am tring to accomplish is to search strretval for a &#060;a href="http://" and add a Target="_blank" to the end. <BR><BR>The replace function just shows the last portion and not the entire text with the the additions. It only displays the last change. <BR><BR>Any Sugestions,<BR><BR>Mike Palmer

  2. #2
    Join Date
    Dec 1969

    Default RE: Help with Replace code

    Try The Following:<BR><BR>strRetval = "&#060;a href=""""&#062;"<BR><BR>intStart = 1<BR><BR>response.write "intStart = " & intStart<BR><BR>intStart = InStr(intStart,strRetval,"&#060;a href=""http://",1)<BR><BR>If Not intStart = 0 Then<BR><BR> strRetval=Replace(strRetval,"&#062;"," Target=&#039_blank&#039&#062;",intStart, 1, 1)<BR><BR> response.write strRetval & "4GuysFromRolla&#060;/A&#062;"<BR><BR>End If<BR><BR>Jesse

Posting Permissions

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