for example

listbox items are:
hello mary
need sugar
teach them
good by


text1.textis:
Salma


richtext.text is:
example1: hfe urefheur hrfer f Salma need sugar jdsud hdcbuds

in this case the word Salma is followed by on of the list items
so delete this item from the list and delete from the richtext

so we will get this :
listbox items are:
hello mary
teach them
good by


richtext.text is:
example1: hfe urefheur hrfer f Salma jdsud hdcbuds

example2: hfe urefheur hrfer f Salma jdsud hdcbuds



here the word Salma is followed by a word which is not an item of the list
so nothing will happen in this case


is it clear now