commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chad Johnson <>
Subject Re: Possible addition to StringUtils
Date Tue, 11 Dec 2001 05:01:17 GMT
----- Original Message -----
From: "Laird J. Nelson" <>
To: "Jakarta Commons Developers List" <>
Sent: Monday, December 10, 2001 9:00 PM
Subject: RE: Possible addition to StringUtils

> Respectfully disagree.  If someone calls the escape method on a string,
> and wants, say, single quotes escaped, then all single quotes in the
> string, period, should be escaped.  But then I tend to think
> escaping-type methods should be designed to be used in one shot on
> possibly unknown strings--hit the string in question once, and bang: no
> muss, no fuss.  :-)
> Cheers,
> Laird

  After running an example through my head of getting input that is
quoted, I'd have to agree.  If I got the string "bob''s" as input I'd want
to get it escaped to "bob''''s" so I could get it properly unescaped back
to its original form.  That line of thinking takes me to my next question
for the list...  Should an unescape method also be added?  As far as I can
tell this method won't run into the same problem as the current escape()
method does (with regards to unescaping), as long as we deal with single
chars for the charsToEscape and escapingChar variables.

-Chad Johnson

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message