>>First, do not use CHRTRAN() use STRTRAN():
>>
>>m.ReplaceWith = ''
>>m.PrefixSearchString = [ MR MRS MS MISS DR PROF SIR MASTER REV REVERAND ETC ]
>>FOR x = 1 TO GETWORDCOUNT( m.PrefixSearchString )
>> m.LookFor = [ ]+ALLTRIM(UPPER(GETWORDNUM(m.PrefixSearchString,x)))+[ ]
>> tcName = STRTRAN([ ]+UPPER(tcName)+[ ],m.LookFor,m.ReplaceWith)
>>ENDFOR
>>
>
>Ok, that worked. Mostly. The other thing that is happening is that tcName is getting converted to uppercase, which is not what I want. How can I preserve the case and still get a valid replacement?
VFP9 has case-sensitive STRTRAN.
If it's not broken, fix it until it is.
My Blog