Imports System.IO Imports System Imports System.Collections.Generic Public Class Form1 Dim replacementWords As List(Of String)() Private replacements As New Dictionary(Of String, List(Of String)) Private nextCheckIndex As Integer Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Using reader As New StreamReader("C:\Users\Acer\Desktop\Text Files\output10.txt") Do Until reader.EndOfStream Dim parts = reader.ReadLine().Split("|"c) If replacements.ContainsKey(parts(0)) Then replacements(parts(0)).Add(parts(1)) Else Dim newWordList As New List(Of String) newWordList.Add(parts(1)) replacements.Add(parts(0), newWordList) End If Loop End Using RichTextBox1.Text = "You provided a bad advice, irregardless of your intention. You provided a bad advice, irregardless of your intention. " End Sub Private Sub CheckForReplacementText() If nextCheckIndex = replacements.Count Then MessageBox.Show("Check complete.") End If Try Dim checkWord As String = replacements.Keys.ElementAt(nextCheckIndex) Dim foundIndex As Integer = RichTextBox1.Find(checkWord, 0, RichTextBox1.TextLength, RichTextBoxFinds.WholeWord)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)