commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36584] New: - adding a StringUtils.replace method that takes an array or List of replacement strings
Date Fri, 09 Sep 2005 21:01:02 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36584>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36584

           Summary: adding a StringUtils.replace method that takes an array
                    or List of replacement strings
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Lang
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: mchyzer@yahoo.com


I have the situation where I have a String template with a dozen replacements 
I need to make.  When I loop through and use StringUtils.replace each time, it 
has to make a StringBuffer of the whole template each time.  I think we could 
make this more efficient if we had a replace() method which took an array of 
Strings to search for, and an array of Strings to replace with (or we could 
use a Collection or List or something).  This way we could possibly do the 
replace in one StringBuffer result.

One issue is if the replacement text has Strings to be replaced, do we iterate 
through again until there are no Strings to search for?  Based on your 
replaceChars(String str, String searchChars, String replaceChars) method, I 
assume the answer is no, but we could have a boolean flag to have it both ways.

I can write this for you if you are interested, please let me know.

Thanks!
Chris

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message