WEB开发网      婵傜晫鐝總钘夊瀻娴滎偓绱掓担鐘垫畱娑撯偓娴犺棄鍨庢禍顐fЦ閹存垳婊戦惃鍕娴犺棄濮╅崝娑崇幢鐠囧嘲鍨庢禍锟� ---閿曪拷
开发学院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:查找 替换 字符

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