Re: Some strange behaviors of enums and string.startsWith

2016-04-08 Thread Andre via Digitalmars-d-learn
On Friday, 8 April 2016 at 14:56:51 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 14:38:10 UTC, Andre wrote: Therefore I use std.conv.text to convert the string enum? to string. That converts the *name* of the enum to string, not the contents. (BTW, I think the name of the enum is

Re: Some strange behaviors of enums and string.startsWith

2016-04-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 8 April 2016 at 14:38:10 UTC, Andre wrote: Therefore I use std.conv.text to convert the string enum? to string. That converts the *name* of the enum to string, not the contents. (BTW, I think the name of the enum is actually the more useful behavior.) Use cast(string) if you

Some strange behaviors of enums and string.startsWith

2016-04-08 Thread Andre via Digitalmars-d-learn
Hi, I have some issues with enums. Please have a look at the last 3 assertions. It is annoying that I cannot directly use my StringEnum for startsWith. Therefore I use std.conv.text to convert the string enum? to string. But then the assertion fails, that is very strange, it fails only for