You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2023/12/18 06:25:00 UTC

[jira] [Updated] (GROOVY-11252) StringGroovyMethods should have a getCodePoints method

     [ https://issues.apache.org/jira/browse/GROOVY-11252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King updated GROOVY-11252:
-------------------------------
    Description: 
The String class has:
{code}
byte[] getBytes()
{code}

Groovy provides in StringGroovyMethods:
{code}
char[] getChars(final CharSequence self)
{code}

I propose adding to StringGroovyMethods:
{code}
int[] getCodePoints(final CharSequence self)
{code}

It is basically just a shortcut to ".codePoints().toArray()" but allows traditional Groovy conventions of using the "codePoints" property.

  was:
the String class has:
{code}
byte[] getBytes()
{code}

Groovy provides in StringGroovyMethods:
{code}
char[] getChars(final CharSequence self)
{code}

I propose adding to StringGroovyMethods:
{code}
int[] getCodePoints(final CharSequence self)
{code}

It is basically just a shortcut to ".codePoints().toArray()" but allows traditional Groovy conventions of using the "codePoints" property.


> StringGroovyMethods should have a getCodePoints method
> ------------------------------------------------------
>
>                 Key: GROOVY-11252
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11252
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Paul King
>            Priority: Major
>
> The String class has:
> {code}
> byte[] getBytes()
> {code}
> Groovy provides in StringGroovyMethods:
> {code}
> char[] getChars(final CharSequence self)
> {code}
> I propose adding to StringGroovyMethods:
> {code}
> int[] getCodePoints(final CharSequence self)
> {code}
> It is basically just a shortcut to ".codePoints().toArray()" but allows traditional Groovy conventions of using the "codePoints" property.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)