Stephen Colebourne wrote:
From: "Phil Steitz" <[EMAIL PROTECTED]>

+1, replaceChars should be like calling replaceChars(String, char, char)
multiple times.

hmm. I think that was what I was referring to as "bugged." The problem is that, as Gary points out above, the old CharSetUtils.translate() really works like a simple translation map, passing the string just one time and performing the indicated character replacements. The behavior now in replaceChars() is as you describe -- so if the replacement map takes c_1 to c_2 and c_2 to c_3 (and c_1 preceeds c_2 in the searchString) the net effect will be c_1 |-> c_3. Is this really how we want it to work?

Er no, replaceChars("abc", "ab", "bc") = "bcc" (multiple times based on the original string...) Stephen


OK we agree then that the current code is incorrect, since it returns "ccc" for the case above.



Phil



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to