How to extend the string class to return this inside the square bracket?

Marcone marcone at email.com
Fri Aug 13 21:05:22 UTC 2021


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")]);
     }


More information about the Digitalmars-d-learn mailing list