Stride

Ali Çehreli acehreli at yahoo.com
Sun Feb 12 13:53:02 PST 2012


On 02/12/2012 11:05 AM, RenatoL wrote:
> Mmmm.... this doesn't compile....
>
> import std.stdio;
> import std.algorithm;
> void main()
> {
>      string s1 = "abcd";
>      s1 = s1[stride(s1,0)..1] ~ 'r' ~ s1[2..$];
>      writeln(s1);
> }
>
> Error: undefined identifier stride, did you mean alias string?

Because I am not operating correctly lately. :(

I meant std.range, not std.algorithm. But std.range.stride will cause a 
different compilation error because it returns a range object, not an index.

Ali


More information about the Digitalmars-d-learn mailing list