import std.algorithm;
import std.stdio;
import std.string;

string stripNewlines(string text)
{
    auto x = text.countUntil("\n");
    auto y = text.lastIndexOf("\n");

    return text[x+1..y];
}

template EOS(string text)
{
    enum EOS = stripNewlines(text);
}

void main()
{
    writeln(EOS!"
    - First item:  150
    - Second item: 200
    - Third item:  105
    ");
}

Reply via email to