• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to replace letters?  RSS feed

 
Iliyan Iliev
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm newbie in Java and I can't figure out why my code doesn't work. My task is to replace for example ä=>ae, using this method String.charAt(int index). So here is my code:





I would be thankful, if you give me some advices When I launch my code I get the same String and nothing has changed

P.S How can I wrap my code here, tried but didn't work
 
Knute Snortum
Sheriff
Posts: 4274
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The charAt() method returns a char type, not an int, although an int will hold it.

What does



do? Hint: you're not concatenating strings.

For your code, you can UseCodeTags. You start with [ code ], then the program, then [ \code ], but take out the spaces between the brackets and the word "code".
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You write [code=java] and that appears as [code=java]

I shall correct the spelling error in your post: with should be will.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!