www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - formattedRead string without allocation?

I want to use formattedRead to enforce a certain format, and easily 
parse out the data from a string.

But if I do:

string s = "123:abc:123";

string y;
assert(s.formattedRead!"123:%s:123"(y) == 1);

y is now a newly-allocated string, not a slice of the input. In the case 
of parsing strings out of strings that aren't going away, it would be 
much more advantageous to simply slice the input. Is there something 
that does this?

-Steve
Feb 24 2018