1

I need to write a helper method to generate a username for a given name-surname couple, such that it should return "amyfarrah.fowler" for name = "Amy Farrah" and surname = "Fowler".

How can i be sure that my username has only ascii chars if name-surname is something like name = "ÄLİÇEÜ TÃRIĞ" surname = "GRÖßERŞİLT". The method should return "aliceutarig.grobersilt". It can be done replacing each non-ascii character with the desired one but I wonder if there is any easier solution.

Thanks in advance.

UPDATE: I need to do this using C#

Ivaylo Strandjev
  • 69,226
  • 18
  • 123
  • 176
Mehmet Ataş
  • 11,081
  • 6
  • 51
  • 78
  • Sorry forgot to mention it. You can see my update. – Mehmet Ataş Oct 03 '12 at 12:57
  • Try to always tag your question with the language you mean. This will make it easier for people to help you. Unfortunately I am not aware of any c# library that can help you achieve what you want and honestly saying I doubt there is one. – Ivaylo Strandjev Oct 03 '12 at 12:59
  • 2
    Actually have a look [here](http://stackoverflow.com/questions/7470997/replace-german-characters-umlauts-accents-with-english-equivalents) should help you. – Ivaylo Strandjev Oct 03 '12 at 13:01
  • Thanks! It seems to solve most of my non-ascii character issues. – Mehmet Ataş Oct 03 '12 at 13:14

0 Answers0