What's the preferred way to substring in D language?

Viewed 1778

I have googled but just no luck.

I want to chop the first character of a string like this:

string s = "hello, world";
string t = cast(string) s[1..$];  // OK
string u = s[1..$]; // ERROR, can't cast char[] to string.

Well, I may miss something. cast(string) make the code more unreadable.

Is there any easier way to get the substring (without cast)?

1 Answers
Related