chaining splitters

dnoob via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 10 17:00:38 PDT 2015


Hello,

I am parsing some text and I have the following;

string text = "some very long text";

foreach(line; splitter(text, [13, 10]))
{
	foreach(record; splitter(line, '*'))
	{
		foreach(field; splitter(record, '='))
		{
			foreach(value; splitter(field, ','))
			{
				// do something...
			}
		}
	}
}

I know there is a better way to do that but I'm a total D noob.

Thanks!



More information about the Digitalmars-d-learn mailing list