Re: SlicedString Length

2023-10-20 Thread Salih Dincer via Digitalmars-d-learn
Good news! I collected them in a template with the condition of running split() once at compile time. The result seems perfect? What are your thoughts? ```d void main() { auto slc = sliceOff!"abc def ghi"; auto len = slc.length; slc.index = len; import std.stdio, std.algorithm:

SlicedString Length

2023-10-20 Thread Salih Dincer via Digitalmars-d-learn
Hi, I have a string wrapper called SlicedString. What it does is very simple: Returning each piece as a slice with a assured separator at compile time by used indexOf() ! Here it is: ```d struct SlicedString(string E) { long index, back, next = -1; string data; auto length() const {