在字符串中的Java更换字[复制]

问题描述 投票:-7回答:1

这个问题已经在这里有一个答案:

我们如何改变价值“的”有“”在这个字符串“有真正的Story.The故事书背后的这本书是关于英雄她老婆和他们的孩子”

java
1个回答
-1
投票

你可能已经看过多一点到String类中,可用的方法。

String sentence = "There is the book of Real Story. The Story behind the book is about a hero her wife and Their children";
sentence.replace("the","that");
© www.soinside.com 2019 - 2024. All rights reserved.