I just re-did ur app in a console w not using the same logic (i think - uno 7assab ma fhemet how u did ur logic) ma elleh jledeh a3mela upload so here's the code.
oh and it will only replace the word eza la 7ala w ma fi walla virgule walla point .... 7ada
Code:
Module Main
Sub Main()
Try
Dim Stock As Queue = New Queue
Do
Dim Sentence As String
Console.Write("Enter the original sentence : ")
Sentence = Console.ReadLine
If Sentence = Nothing Then Exit Do
Dim OriginalWord As String
Console.Write("Enter the word to change : ")
OriginalWord = Console.ReadLine
Dim Replacement As String
Console.Write("Enter the word to change with : ")
Replacement = Console.ReadLine
Dim Words As Array
Words = Sentence.Split(" ")
Dim Word As String
For Each Word In Words
If Word = OriginalWord Then Word = Replacement
Stock.Enqueue(Word)
Next
Do Until Stock.Count = 0
Console.Write(Stock.Dequeue & " ")
Loop
Console.WriteLine()
Console.WriteLine()
Loop
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Console.WriteLine()
Console.Write("Press ENTER to continue")
Console.ReadLine()
End Sub
End Module
oh and how do you paste something in a variable??
massalane I wanted to tell the user write /CP/ to paste the clipboard bass ma l2it kif fiyeh 7at l clipboard bil variable "Sentence"