WEB开发网
开发学院WEB开发综合 查找替换所选字符 阅读

查找替换所选字符

 2006-02-27 11:41:49 来源:WEB开发网   
核心提示:->FunctionsReplace(SearchLineAsString,SearchForAsString,ReplaceWithAsString)DimvSearchLineAsString,foundAsIntegerfound=InStr(SearchLine,SearchFor):vSearchLine=S
->FunctionsReplace(SearchLineAsString,SearchForAsString,ReplaceWithAsString)
DimvSearchLineAsString,foundAsInteger

found=InStr(SearchLine,SearchFor):vSearchLine=SearchLine
Iffound<>0Then
vSearchLine=""
Iffound>1ThenvSearchLine=Left(SearchLine,found-1)
vSearchLine=vSearchLine ReplaceWith
Iffound Len(SearchFor)-1<Len(SearchLine)Then_
vSearchLine=vSearchLine Right$(SearchLine,Len(SearchLine)-found-Len(SearchFor) 1)
EndIf
sReplace=vSearchLine

EndFunction->
->

Tags:查找 替换 字符

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接