Re: Find and replace problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



This is a work around

First replace Brian with Mr Brian
MyString.Replace("Brian", "Mr Brian");

Then replace Mr Brian MacWoods (notice the "Mr" is now included) with Sir
Brian McWoods
MyString.Replace("Mr Brian MacWoods", "Sir Brian MacWoods");

HTH

"Raed Sawalha" <RaedSawalha@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A1B97ACF-6ED3-4D4C-8EC2-2796C41B72D1@xxxxxxxxxxxxxxxx
>
> 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?
>
>
>


.



Relevant Pages