STRTRAN(cSearched, cExpressionSought [, cReplacement] [, nStartOccurrence] [, nNumberOfOccurrences] [, nFlags])nFlags = 3 is supposed to mean (and this is directly from the help):
Search is case-insensitive; case of cReplacement is changed to match the case of cExpressionSought, which it replaces.It seems (seemed) clear to me that changed to match the case of cExpressionSought meant that if, for instance, cExpressionSought were upper case, then cReplacement would be changed to be upper case.
lcString = 'abracadabra' ? StrTran(lcString, 'A', 'x', 1, 500, 3)Should display
XbrXcXdXbrX(ie) cReplacement ('x') is changed to match the case of cExpressionSought ('A'), but as it turns out, that is not what happens.
xbrxcxdxbrxWhat is actually happening, is that the case of 'x' is being changed to match the case of the string which it is replacing as it is found in cSearched ('abracadabra'), where the 'a's are all lower case.
Search is case-insensitive; case of cReplacement is changed to match the case of the string in cSearched which it replaces.It's a small change; only a couple of words, but I think it makes a huge difference.