网页素材: 导航菜单选项卡滑动门焦点图图片切换下拉菜单弹出层Tabs链接提示

您的当前位置: 源码爱好者 » 网页制作教程(编程教程) » VB技术教程

Vb替换选择的字符串为其它字符

  • 标签:字符串替换 更新时间:2014-07-31
  • VB6.0查找替换所选字符,这个就更简单了,直接上代码吧:

    Function sReplace(SearchLine As String, SearchFor As String, ReplaceWith As String)
    Dim vSearchLine As String, found As Integer
    found = InStr(SearchLine, SearchFor): vSearchLine = SearchLine
    If found <> 0 Then
    vSearchLine = ""
    If found > 1 Then vSearchLine = Left(SearchLine, found - 1)
    vSearchLine = vSearchLine + ReplaceWith
    If found + Len(SearchFor) - 1 < Len(SearchLine) Then _
    vSearchLine = vSearchLine + Right$(SearchLine, Len(SearchLine) - found - Len(SearchFor) + 1)
    End If
    sReplace = vSearchLine
    End Function

    从网上找的代码,当时写一个VB程序时候要用到,曾经用过两次,觉得还不错。

  • 已读: 次 收藏本文关闭本文打印本文复制链接
处理 SSI 文件时出错