views:

564

answers:

3

I have a large CSV with a list of words from a spanish dictionary.

I wish to take each one and put them in a collection belonging to the letter they are in.

i.e abertura goes in A

However, spanish vowels can have accents in them like the world "ácido"

In this case I still want it to go in my "A" collection.

I realise of course, I could do this by just looking for the character codes with a switch statement, but I was wondering if there was maybe a more elegant way of doing this?

+3  A: 

Please see the answer to the following post:

How to change diacritic characters to non-diacritic ones

0xA3
Thanks, if only I had known the word diacritic before I asked the question :p
qui
+2  A: 

For a simple example:

To remove diacritics from a string:

string newString = myDiacriticsString.Normalize(NormalizationForm.FormD);
qui
+1  A: 

But you might want to check this with a native speaker. For a Spanish speaking person these are different characters.

Mihai Nita
+1! It is ... annoying, this tendency to consider diacritics as just some visual coolness, it's really not. It's as weird as sorting I and T together would be, because "the only difference is the crossing line".
unwind