1) Depends what you want to do. For what you want to just you could use the same loop put replace NAME with catx(' ',of name1-name3) in the SCAN function. 2) That is harder to do. To make your IF clauses make sense you want want one to have a higher index than the other. new(i)='Gala' and new(i+1)='MT' for example. But the logic could get very complex to find all possible combinations. You might want to consider pre-processing the string first. Something like: name = tranwrd(name,'MT Gala','Gala') ; name = tranwrd(name,'Gala MT','Gala');
... View more