bjakupovic remove sys. prints (#9208)

This commit is contained in:
Belma Jakupovic 2020-05-02 18:30:36 +02:00 committed by GitHub
parent dd052eb2fc
commit 2b4c2e3c8c
1 changed files with 6 additions and 4 deletions

View File

@ -15,16 +15,18 @@ public class TextManipulator {
text = text.concat(newText); text = text.concat(newText);
} }
public void findWordAndReplace(String word, String replacementWord) { public String findWordAndReplace(String word, String replacementWord) {
if (text.contains(word)) { if (text.contains(word)) {
text = text.replace(word, replacementWord); text = text.replace(word, replacementWord);
} else System.out.println("Word you want to replace is not found in the text"); }
return text;
} }
public void findWordAndDelete(String word) { public String findWordAndDelete(String word) {
if (text.contains(word)) { if (text.contains(word)) {
text = text.replace(word, ""); text = text.replace(word, "");
} else System.out.println("Word you want to delete is not found in the text"); }
return text;
} }
/* /*