2008年6月13日 星期五

去除特定字元

'去除特定字元
Public Class Form1
    Dim str1 As String
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim i As Integer
        str1 = "會明天會更會好"
        Dim s As String = "會"
        Do While InStr(str1, s)
            i = InStr(str1, s)
            str1 = Microsoft.VisualBasic.Left(str1, i - 1) & Mid(str1, i + 1)
        Loop
        MsgBox(str1)
    End Sub
End Class

沒有留言: