It will but you won't see it, because you overwrite the first return value with the second.
you would recode the function as
Code:
function ReplaceChar(strIn,pattern,replaceChar)
dim objRE
set objRE = New RegExp
objRE.pattern = pattern
objRE.Global = True
ReplaceChar= objRE.replace(strIn,replaceChar)
set objRE = nothing
end function
then call it as
stringvar = ReplaceChar(strIN,"a|e","z")
and so on
for multiple replace I use an array and a looping function
Code:
function ReplaceHTML(strItem)
dim i
for i = 0 to ubound(ReplaceCode)
strItem = replace(strItem, ReplaceCode(i,1), ReplaceCode(i,0))
next
ReplaceHTML = strItem
end function
section from the array
Code:
dim ReplaceCode(96,1)
ReplaceCode(77,0) = "[h1]"
ReplaceCode(77,1) = "<h1>"
ReplaceCode(78,0) = "[/h1]"
ReplaceCode(78,1) = "</h1>"
ReplaceCode(79,0) = "[h2]"
ReplaceCode(79,1) = "<h2>"
ReplaceCode(80,0) = "[/h2]"
ReplaceCode(80,1) = "</h2>"
dim replacecode() whatever size you need
the character to replace goes in array(n,0) the character to replace it with goes in array(n,1)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|