Fabio and Gregory,
I think you miss the point of david here. His algortithm is only moving the characters that are in the result and they're moved only once. His algorithm is (more or less) equivalent to the following VFP code
FUNCTION DeQoute (cString)
LOCAL nPointer
nPointer = 0
FOR nT = 1 TO LEN(cString)
cChar = SUBSTR(cString, nT, 1)
IF cChar != '"'
nPointer = nPointer + 1
cString = STUFF(cString, nPointer, 1, cChar)
ENDIF
ENDFOR
cString = SUBSTR(cString,1, nPointer)
RETURN LEN(cString)
Each character is only handled once. Honestly I really don't see any advantage to approach this problem from a right to left strategy here.
The difference with the current implementation of CHRTRAN is that when a iterating through the characters in the string, it is going to move all remaining characters 1 position back whenever a character needs to be deleted. This results in the performance issue posibly a huge number of characters have moved multiple times in one CHARTRAN call. This is certainly not the case in davids algorithm.
Walter,