On 4/13/22 2:26 AM, mw wrote:
Hi,
What's the D's idiom to split a string into an array of every n chars?
(prefer one liner)
str.byChar.chunks(2).array;
Your request of "array of every n chars" is somewhat ambiguous. This is
an array of chunks (not an array of arrays).
-Steve
On 4/12/22 21:34, Salih Dincer wrote:
> I tried the following and I didn't understand one thing: Why is there no
> need to use dup when slicing?
I don't think I understand you fully.
> ```d
> struct S(T) {
> T fileName;
>
>this(T fileName) {
> this.fileName = fileName;
> report(
On Wed, Apr 13, 2022 at 08:39:17AM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 4/12/22 21:34, Salih Dincer wrote:
>
> > I tried the following and I didn't understand one thing: Why is
> > there no need to use dup when slicing?
[...]
Because of two things: (1) there is a GC, and (2) ch
Hi,
I would have thought that RefCounted!(T,
RefCountedAutoInitialize.no) is to be used in place T* when I
want reference counting instead of the usual garbage collection
(or manual allocation). Perhaps this is wrong?
If I am correct what am I doing wrong here?
(Sorry for two space squashed
On Wednesday, 13 April 2022 at 20:47:33 UTC, JG wrote:
Hi,
I would have thought that RefCounted!(T,
RefCountedAutoInitialize.no) is to be used in place T* when I
want reference counting instead of the usual garbage collection
(or manual allocation). Perhaps this is wrong?
[...]
Perhaps I
On Wednesday, 13 April 2022 at 21:15:13 UTC, JG wrote:
On Wednesday, 13 April 2022 at 20:47:33 UTC, JG wrote:
Hi,
I would have thought that RefCounted!(T,
RefCountedAutoInitialize.no) is to be used in place T* when I
want reference counting instead of the usual garbage
collection (or manual