5

A plain simple question: How to convert this string:

Facultatea de Științe Politice, Administrative și ale Comunicării

to this:

Facultatea de Stiinte Politice, Administrative si ale Comunicarii

And consequently all the special characters in a string.

UPDATED SOLUTION BASED ON RELATED QUESTIONS

This can be achieved through a single line of code:

String convertedString = Normalizer.normalize(v.getName(), Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "");
Adrian Olar
  • 2,883
  • 4
  • 35
  • 63
  • your right i found the answer there, thanks so much! Just didn't know how to search for it! – Adrian Olar May 04 '14 at 11:31
  • Ofcourse that code won't work, the only thing it does is convert characters to bytes and back again, the output is exactly the same as the input. That won't magically get rid of the diacritical marks. – Jesper May 04 '14 at 11:56
  • @Jesper thanks for your comment, i managed to find the solution. – Adrian Olar May 04 '14 at 12:04

0 Answers0