I am trying to build a simple find/replace code. I can not seem to subtract with the LEFT or RIGHT or MID functions. Can someone please help with the syntax? Thank you
<%
Dim InputPhrase, FindChar, ReplaceChar, PhraseLength,
NewPhrase,PartA,PartB,founda
InputPhrase=Request.Form("Phrase"
FindChar=Request.Form("FindMe"
ReplaceChar=Request.Form("ReplaceMe"
Phraselength=len(InputPhrase)
newphrase=inputphrase
For varCounter=1 to PhraseLength
founda=InStr(NewPhrase,FindChar)
<!--PartA is the string before the found character-->
PartA = Left(newphrase,founda-1)
<!--PartB is the remaining string-->
PartB = Right(newPhrase,4)
<!--Rebuild string and trim out space before next loop-->
NewPhrase = trim(parta) &Trim(ReplaceChar)&Trim(PartB)
Next
response.write NewPhrase
%>
<%
Dim InputPhrase, FindChar, ReplaceChar, PhraseLength,
NewPhrase,PartA,PartB,founda
InputPhrase=Request.Form("Phrase"
FindChar=Request.Form("FindMe"
ReplaceChar=Request.Form("ReplaceMe"
Phraselength=len(InputPhrase)
newphrase=inputphrase
For varCounter=1 to PhraseLength
founda=InStr(NewPhrase,FindChar)
<!--PartA is the string before the found character-->
PartA = Left(newphrase,founda-1)
<!--PartB is the remaining string-->
PartB = Right(newPhrase,4)
<!--Rebuild string and trim out space before next loop-->
NewPhrase = trim(parta) &Trim(ReplaceChar)&Trim(PartB)
Next
response.write NewPhrase
%>