Function KillYou(Str)
glcontent = "过滤,指定,关键字"
P_Key = Split(glcontent,",")
For i = 0 to Ubound(P_Key)
Str = Replace(Str,P_Key(i),"**")
Next
KillYou = Str
End Function
当过滤内容中有设置的字符时可以正常替换为*号,但是如果要过滤的内容中没有关键字时,刚内容显示不出了
...全文
1367打赏收藏
这个过滤函数有什么问题?
Function KillYou(Str) glcontent = "过滤,指定,关键字" P_Key = Split(glcontent,",") For i = 0 to Ubound(P_Key) Str = Replace(Str,P_Key(i),"**") Next KillYou = Str End Function 当过滤内容中有设置的字符时可以正常替换为*号,但是如果要过滤的内容中没有关键字时,刚内容显示不出了
Function KillYou(Str)
glcontent = "过滤,指定,关键字"
P_Key = Split(glcontent,",")
For i = 0 to Ubound(P_Key)
if instr(str,P_Key(i)) then
Str = Replace(Str,P_Key(i),"**")
end if
Next
KillYou = Str
End Function