You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by "Daniel.Sun" <su...@apache.org> on 2018/01/01 03:23:37 UTC

Re: About adding DGM startsWith(String...) and endsWith(String...)

OK. I'll create one later. Happy New Year :-)

Cheers,
Daniel. Sun




--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

RE: About adding DGM startsWith(String...) and endsWith(String...)

Posted by er...@thomsonreuters.com.
Isn't the trend to use CharSequence instead of String?  If it's startsWith, shouldn't the signature be startsWith(String one, String two, String... more) to avoid zero params and conflict with 1 param built-in method?

Couldn't this be just as easily expressed using the any DGM?

['prefix1', 'prefix2', ...].any { string.startsWith(it) }


Re: About adding DGM startsWith(String...) and endsWith(String...)

Posted by Daniel Sun <re...@hotmail.com>.
The issue to track the feature has been created:
https://issues.apache.org/jira/browse/GROOVY-8428

Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html