File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Replace à with A using Java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Replace à with A using Java code" Watch "Replace à with A using Java code" New topic

Replace à with A using Java code

vijay k vemula

Joined: Dec 17, 2008
Posts: 10
Hello every one,

First of all i would like to thank you for your previous valuable suggestions. Currently i am working on a Java/JSF application where i got a problem as below.

In our database, we have a special character à (tilde symbol on top of letter A (letter can be any alphabet))......

Now the requirement is i need to replace this special character à with A......

Any advice/suggestion is highly appreciated. Thanks in advance.
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

vijay k vemula

Joined: Dec 17, 2008
Posts: 10
Hi Paul,

Thanks for your early response, i really appreciate it. Still i want to explain my requirement clearly as below

Some of the names in our database has these special character (tilde) Ñ and ñ, PaulÃ.........

So in the name string, i had to replace these special characters, for example if name comes from database as DOMINOÃ i need to display DOMINO.

could you please advice/suggest me on this.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46362
What makes you think they are special characters? No Spaniard would think Ñ is a special character. What encoding are you using in your database? Do you have non-English names in your database? Is Dominoã the correct spelling? Can you create a regular expression to apply to the replaceAll() method?

i think this is too difficult a question for "beginning", and shall move this discussion.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Why do you want to solve this with Java? Why not write an sql update-statement? I'm no sql guru but I bet that this can be done.

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
It is sorta covered in the JavaRanch Style Guide.
subject: Replace à with A using Java code
It's not a secret anymore!