This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Replace à with A using Java code" Watch "Replace à with A using Java code" New topic
Author

Replace à with A using Java code

vijay k vemula
Greenhorn

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
Sheriff

Joined: Oct 14, 2005
Posts: 19750
    
  10

vijay k vemula
Greenhorn

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)....like Ñ 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
Sheriff

Joined: Oct 13, 2005
Posts: 44563
    
  34
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Replace à with A using Java code
 
jQuery in Action, 3rd edition