JDK-8288550 : String not implementing Iterable
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 17
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2022-06-15
  • Updated: 2022-07-26
  • Resolved: 2022-07-26
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE PROBLEM :
The java.lang.String class should implement a way to iterate through it's characters with an enhanced for loop and or streams. This is currently not possible without using something like String.toCharArray() which copies data to perform immutable iterations. 



Comments
This functionality was provided by JDK-8012665; see the String.chars() and String.codePoints() method.
26-07-2022

Moved to JDK for more evaluations of the requested enhancement.
16-06-2022