Dim path As String = "C:\sms\smsspicy.txt"
Dim Str As String
Dim StrRe As String
Dim ArrayText() As String
Dim StringCount As Integer
Str = "abc,def,ghi" 'ข้อความที่ต้องการตัด
StrRe = Str.Replace(",", "x")
ArrayText = StrRe.Split("x")
For i As Integer = 0 To ArrayText.Length - 1
Me.TextBox2.Text = ArrayText(i)
TextBox1.Text = "อัพเดทข้อความ"
If String.IsNullOrEmpty(TextBox2.Text) Then
TextBox2.Text = "ขอบคุณที่ร่วมแสดงความคิดเห็น " + sms
ElseIf (substring = "...") Then
TextBox2.Text = "ขอบคุณที่ร่วมแสดงความคิดเห็น " + sms
End If
' Create or overwrite the file.
Dim fs As FileStream = File.Create(path)
' Add text to the file.
Dim info As Byte() = New UTF8Encoding(True).GetBytes(TextBox2.Text)
fs.Write(info, 0, info.Length)
fs.Close()
Next i