[Issue 7281] std.string.reversed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 12 16:06:54 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7281


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #3 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-01-12 16:06:50 PST ---
(In reply to comment #2)
> Your example is not the shortest way of doing this. The typical way would be
> 
> array(retro(str));
> 
> which _is_ an expression and almost as concise as
> 

You can't assign that back to a string:

    string str = "foo";
    str = array(retro(str)).idup;  // error

I don't know why array insists on creating dchar[] instead of char[]? Shorter
example:

char[] duped = array(str);  // error: can't convert dchar[] to char[]

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list