String.replace result is ignored?

后端 未结 4 811
死守一世寂寞
死守一世寂寞 2021-01-20 13:20

So i\'m using IntelliJ and the replace buzzword is highlighted. Most of the tips are over my head so i ignore them, but what i got for this one was that the result of string

4条回答
  •  佛祖请我去吃肉
    2021-01-20 14:10

    use that statement string = string.replace(string.charAt(i));

    Why? String is an immutable object. Look at this thread to get a complete explanation. This a fundemental part of Java, so make sure you learn it well.

提交回复
热议问题