enum string

Namespace rswhite4 at googlemail.com
Tue Aug 7 10:05:01 PDT 2012


[code]
import std.regex;

enum Token : string {
	Blank = r"\s+"
}

void main() {
	const string text = "Foo Bar";

	// text.split(regex(Token.Blank)); // don't work
	
	const string blank = Token.Blank;
	text.split(regex(blank)); // work
}
[/code]

Can me somebody explain that? o.O


More information about the Digitalmars-d-learn mailing list