Question Locked

Upper/lower case sorts

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
We are building a .NET application that offers dynamic on-screen sorting. However, we find that the sorting doesn't work properly as desired for upper vs. lower case. If I want to sort on the name Van de Camp and someone entered it van de Camp, then my on-screen sort will make me look in separate places for those two. We've thought about using all upper case, but it makes extration for things like letter variables (i.e. Dear Mr. VAN DE CAMP) unsightly. Has anyone else found a clever solution to this sort of challenge?

6 replies

by zenadu

I?m not sure this helps. It answers the question about comparing, but not sorting. Can you add any insight how to sort data in alpha order regardless of data case?

by older mycroft

[i]"However, we find that the sorting doesn't work properly as desired for upper vs. lower case"[/i]

Obviously what you really meant to say was [i]"We are building a .NET application that offers dynamic on-screen sorting. - [b]Could someone please do the entire project for us?[/b][/i]

ERGO - my initial sarcastic joke! ;)

by tony hopkinson

Sort calls compare. :p

Sort puts things in order, order is defined by comparing one record with another in a specific fashion. Case sensitive alpha numeric english, is simply the default comparison, helpfully provided by installing .net in a western locale.

Another link, with some custom sorting advice.

http://blog.paranoidferret.com/index.php/2008/05/06/c-snippet-tutorial-custom-list-sorting/

HtHs a bit more. You might want to buy yourself a .NET book and find out the basics of what is already in there. Otherwise you are going to be spending a lot of time inventing roundy things, others have called wheels.

That's not as much of a p1ss takes as it sounds. It got me as well. :(

This discussion is closed to new replies.