You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Andres Almiray (JIRA)" <ji...@apache.org> on 2015/06/19 17:43:01 UTC

[jira] [Commented] (GROOVY-7472) Missing uncapitalize method

    [ https://issues.apache.org/jira/browse/GROOVY-7472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593533#comment-14593533 ] 

Andres Almiray commented on GROOVY-7472:
----------------------------------------

Fixed with https://git-wip-us.apache.org/repos/asf?p=incubator-groovy.git;a=commit;h=791e71f4d35a85dcef2fb338a681002166b9f20a

> Missing uncapitalize method
> ---------------------------
>
>                 Key: GROOVY-7472
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7472
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-jdk
>    Affects Versions: 2.4.3
>            Reporter: Andres Almiray
>            Assignee: Guillaume Laforge
>            Priority: Minor
>             Fix For: 2.5.0-beta-1
>
>
> Groovy has had a `capitalize` method since 1.8.2 but it does not have the mirror opposite: `uncapitalize`.  A few weeks ago I was working with string manipulations and was surprised by this omission.
> Based on http://docs.groovy-lang.org/latest/html/groovy-jdk/java/lang/CharSequence.html#capitalize() the rules for uncapitalize should be as follows:
> {code}
> assert 'H'.uncapitalize() == 'h'
> assert 'Hello'.uncapitalize() == 'hello'
> assert 'Hello world'.uncapitalize() == 'hello world'
> assert 'Hello World'.uncapitalize() == 'hello World'
> assert 'hello world' ==
>     'Hello World'.split(' ').collect{ it.uncapitalize() }.join(' ')
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)