Char.length

sigod via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 10 15:49:40 PDT 2014


On Thursday, 10 July 2014 at 17:01:45 UTC, Jane Doe wrote:
>     auto last(T)(T s) { return s[s.length-1]; }
>
>     void main()
>     {
> 	writeln(last("asdf"));
> 	writeln(last('c'));       // fails!! But surely this should 
> work!
>     }

Yes, it should, if it's JavaScript.

Can you show some cases that bothers you so much?


More information about the Digitalmars-d mailing list