Error in String.replace Java

Asked

Viewed 55 times

0

I’m having a hard time getting the String.replace("á","a")

In my case I type Canadá and I want out houseboat, but in the output appears instead of a square, as if there were an invalid character.

  • 2

    This ai is not java problem is not file encoding problem . java that your IDE or text editor is creating. Look, it works perfectly: https://ideone.com/3d5Xps

  • I was not the one who said no, because I found the question relevant and curious, but it would be nice for you to post a print of this result that is occurring in your IDE.

  • This is the way out: canad

  • So the problem is what I mentioned in the first comment, for sure. Check the encoding your IDE or text editor is using to create the files .java.

  • I checked here and it really is a problem in Netbeans. Using an online compiler worked. Thanks for the help!

  • 1
  • It worked perfectly after that modification! Thank you!

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.