如何在文本框中查找并替换文字?

解决方案 »

  1.   

    pos = InStr(1, text1.Text, "abc")
    if pos>0 then
    text1.Text=left(text1.Text,pos-1) & "xyz" & " mid(text1.Text,i+len("abc"))
    endif  
    *****************************************************************************
    欢迎使用CSDN论坛阅读器 : CSDN Reader(附全部源代码) 
    http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
      

  2.   

    replace(expression, findstring, yourstring)
      

  3.   

    例如:
    文本为  abcdeabcd
    查找出c并把它替换成 回车
    要显示的结果是:
    ab
    deab
    d
      

  4.   

    同意楼上:
    private sub command1_click()
      dim s as string
      s="abedeabcd"
      s=replace(s,"c",vbcrlf)
      debug.print s
    end sub
      

  5.   

    都写完了,我来接分了!!!
      replace 这个函数比较的好点哦