groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: About adding DGM startsWith(String...) and endsWith(String...)
Date Tue, 02 Jan 2018 15:27:13 GMT
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) }

View raw message