比如我要读取桌面上的一个叫a.txt里的指定内容……比如这个A.TXT里内容是这样的
空我爱你。
空我想你。
空我想见你。
空我真的想你。
我要在文本框里读取
我爱你
我想你
我想见你
我真的想你
这个怎么做?

解决方案 »

  1.   

    逐行取出
    用Mid取出后面的
      

  2.   


    Private Sub Form_Load()
    Dim ictr, jctr As String
    Dim i As String    Open "D:\A.txt" For Input As #1
            Do While Not EOF(1)
               Line Input #1, i
               Text1 = Text1.Text & Replace(i, "空", "")
            Loop
        Close #1End Sub
      

  3.   

    方法有很多种:
    a=right(a,len(a)-1)
      

  4.   


    F2 有一个 Bug,会删除正文中的“空”字。例如:空我有空就去看你。
      

  5.   

    使用Replace,比如:Dim strText As String
    Open filename For Binary as #1
    strText=Input(Lof(1),1)
    Close #1
    strText = Mid(Replace(vbCrLf + strText,vbCrLf + "空",vbCrlf+""),3)
    Debug.Print strText
      

  6.   

    使用int Replace( TCHAR chOld, TCHAR chNew );   新字符替换老字符
      

  7.   

    chOld设为'空'
    chNew设为 NULL