Code:
Dim neededletter As String = "@"
Dim strA As String = ""
Dim arrA As Array
Dim strB As String = ""
Dim youwanttocopythis As String = ""
Dim file As New System.IO.StreamReader("filename.txt")
Do Until file.EndOfStream
strA = file.ReadLine
arrA = strA.Split(" ")
For b = 0 To arrA.Length - 1
strB = arrA.GetValue(b)
If strB.Contains(neededletter) Then
TextBox1.Text = TextBox1.Text & strB
End If
Next
Loop
file.dispose()
file.close()
OR from a RichTextBox:
Code:
Dim neededletter As String = "@"
Dim strA As String = ""
Dim arrA As Array
Dim strB As String = ""
Dim youwanttocopythis As String = ""
For a = 0 To RichTextBox1.Lines.Length
strA = RichTextBox1.Lines.GetValue(a)
arrA = strA.Split(" ")
For b = 0 To arrA.Length - 1
strB = arrA.GetValue(b)
If strB.Contains(neededletter) Then
TextBox1.Text = TextBox1.Text & strB
End If
Next b
Next a
(Both are my work)