groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Kemnade (JIRA)" <>
Subject [jira] [Commented] (GROOVY-7540) Add StringGroovyMethods.collectReplacements(String, Map)
Date Thu, 06 Aug 2015 11:29:06 GMT


Jochen Kemnade commented on GROOVY-7540:

If we don't do "incremental" replacement, the order is only relevant for those cases where
the source strings overlap, right?
String.replace also compiles the String to a Pattern and creates a Matcher, creating multiple
StringBuilders and whatnot on the way. I'd like to avoid most of that.
I also wouldn't try to do repeats. Should we just copy the relevant parts of {{StringUtils}}?

> Add StringGroovyMethods.collectReplacements(String, Map)
> --------------------------------------------------------
>                 Key: GROOVY-7540
>                 URL:
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Jochen Kemnade
>            Priority: Minor
> It should be possible to use a map with {{collectReplacements}}, like in
> {code}
> "f006ar".collectReplacements(["0":"o", "6":"b"])
> {code}

This message was sent by Atlassian JIRA

View raw message