[Issue 5201] std.string.indexOf and std.algorithm.indexOf return different things for narrow strings

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 16 12:17:16 PST 2010


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


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #1 from Jonathan M Davis <jmdavisProg at gmx.com> 2010-11-16 12:16:03 PST ---
I would think that you'd want character arrays and indexOf to always function
like it does in std.string - the index is the index of the array, but
comparison is done by code point rather than code unit. So, then I would think
that the correct solution would be either to special case
std.algorithm.indexOf() for all character arrays (and deprecated
std.string.indexOf()) or to make it so that it doesn't work with character
arrays and have std.string.indexOf() deal with them instead. There could be a
good reason that I haven't thought of to not to do it that way though.

-- 
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