Comment #0 by monkeyworks12 — 2013-08-07T13:51:29Z
import std.stdio;
import std.range;
void main()
{
auto str = "石室詩士施氏,嗜獅,誓食十獅。"d;
auto indStr = str.indexed(recurrence!"n"(0));
//[email protected](6177): Range violation
writeln(indStr);
}
This code prints the string correctly, but it seems that it doesn't stop when the end of the string is reached.
石室詩士施氏,嗜獅,誓食十獅。
Comment #1 by monkeyworks12 — 2013-08-07T14:05:20Z
Also, a workaround:
import std.utf;
import std.stdio;
import std.range;
void main()
{
auto str = "石室詩士施氏,嗜獅,誓食十獅。"d;
auto indStr = str.indexed(iota(str.count));
writeln(indStr);
readln();
}
Comment #2 by robert.schadek — 2024-12-01T16:18:35Z