Hello Raed,
Here you have to make two searches for separate words Brian and
Brian MacWoods. First Search for Word Brian, if you find the match then
search for Brian MacWoods using SubString(strString, intstartPosition,
intStartPosition + Len("Brian MacWoods").
Now of you find the second match then replace for Brian MacWoods
else Replace for Brian only. So here you are searching for Brian first and
immediately searching for Macwoods in next 9 Characters.
I hope this will sort out your problem.
--
Ankit Gurjar
an*********@hotmail.com
"Raed Sawalha" <Ra*********@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
I have the following text:-
Brian went to stadium to watch the soccer game, Brian MacWoods is
bussiness
man and very rich man.
Brian likes to run every morning on beachside.
the problem i have I get the list of words that should be replace in the
provided text as follows:-
Brian (ONLY) : should be replaced by Mr with Brian word itself==> will be
after replacing(Mr Brian)
Brian MacWoods (Togather): should be replace by Sr with Brian MacWoods = >
will be after replacing(Sr Brian MacWoods)
how can i achieve this stuff of text replacing without have problem in the
name conflict (that when replay Brian(ONLY) do not replace the Brian in
Brian
MacWoods?