On 8/13/21 5:05 PM, Marcone wrote:
How to extend the string class to return this inside the square bracket the same way opDollar $ returns the length of the string? Thank you.

     import std;

     void main(){
         writeln("Hello World!"[0..this.indexOf("o")]);
     }

There is no string class to extend.

`$` is a special token the compiler changes to `arr.length` for arrays.

-Steve

Reply via email to