bjakupovic remove sys. prints (#9208)
This commit is contained in:
parent
dd052eb2fc
commit
2b4c2e3c8c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue