Sorting a String? (PR #16853)

96 views
Skip to first unread message

Scott Jones

unread,
Jun 10, 2016, 6:21:54 PM6/10/16
to julia-dev
I know it isn't very much code, but I was wondering what the use case of this would be?
In all my time doing lots of string processing, I don't think I ever needed this.
Since a String isn't normally treated as an array, and it is simple enough to get a vector of characters from a string which can then be sorted, if you really needed to.

I'd rather see this fall back to a error, like Number.

(What I did, many times, was take the characters from some (generally large) text, and see with a sparse bit map all the characters present, or count the frequencies of the characters,
but sorting is not needed for that.  Just sorting the Unicode characters also doesn't make too much sense, you'd really want to find all of the graphemes and sort those, I'd imagine.)

-Scott

Reply all
Reply to author
Forward
0 new messages