Re: [RFC] StringBuilder.toCharArray

2018-07-18 Thread Martin Buchholz
You can already copy a StringBuilder's contents into a String or another StringBuilder. What would Josh say? "Doesn't pull its weight." ?! On Wed, Jul 18, 2018 at 7:29 AM, Isaac Levy wrote: > Is there any interest in a toCharArray method for StringBuilder? I'm > unable to to make a bug for it.

[RFC] StringBuilder.toCharArray

2018-07-18 Thread Isaac Levy
Is there any interest in a toCharArray method for StringBuilder? I'm unable to to make a bug for it. Just a bit of sugar: char[] toCharArray() { int length = length(); char[] dst = new char[length]; getChars(0, length, dst, 0); return dst; } Regards, Isaac