Ah you beat me by a minute.  :-)

But yes that is would I would naturally do.  It is not correct on certain 
languages and such and doing a regex case-insensitive match would be more 
accurate, but that is a lot of comparisons to do too if your list gets big, 
but if the count is small and they are english then that is fine.  :-)


On Friday, September 9, 2016 at 10:18:56 AM UTC-6, Rudolf Bargholz wrote:
>
> Could this be the correct answer to my own question?
>
> import Html exposing (text)
> import List
> import String
>
>
> main =
>   text (toString sorted)
>
>
>  
> strings = ["Here", "are", "some", "sample", "strings", "to", "be", 
> "sorted"]
> sorted = List.sortBy String.toUpper strings
>
>
>
>
>
>
> On Friday, September 9, 2016 at 5:45:01 PM UTC+2, Rudolf Bargholz wrote:
>>
>> Hi,
>>
>> Failing here dismally, so I hope someone here is kind enough to help out.
>>
>> *Problem*: I have a list of strings and want to sort the list 
>> independant of the case of the chars in the string
>>
>> What I have so far:
>>
>> > import List
>> > import String
>> > unorderedList = [ "c", "B" , "a"]
>> ["c","B","a"] : List String
>> > orderedList = List.sort unorderedList
>> ["B","a","c"] : List String
>> > orderedList2 = unorderedList |> List.map String.toUpper |> List.sort
>> ["A","B","C"] : List String
>>
>>
>> What I am trying to acheive is the following result:
>>
>> ["a","B","c"] : List String
>>
>> I must be overlooking something easy. 
>>
>> Could anyone point me in the right direction how I can accomplish this?
>> Is there any resource that has numerous Elm examples on how to use 
>> *List.sort*, *List.sortBy* and *List.sortWith*?
>>
>> Regards
>>
>> Rudolf Bargholz
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to