changes in TextLogik.java

This commit is contained in:
schrom01 2021-11-11 14:45:36 +01:00
parent b0622643d4
commit 7ed50f6d9f
1 changed files with 2 additions and 3 deletions

View File

@ -69,11 +69,10 @@ public class TextLogik {
break; break;
case "REPLACE": case "REPLACE":
if (command.length == 1){ if (command.length == 1){
text.replace(TextInput.getTextInput(), TextInput.getTextInput()); checkIfSuccess(text.replace(TextInput.getTextInput(), TextInput.getTextInput()));
}else if(isNumeric(command[1])) { }else if(isNumeric(command[1])) {
int line = Integer.parseInt(command[1]); int line = Integer.parseInt(command[1]);
checkIfSuccess(text.replace(line, TextInput.getTextInput(), TextInput.getTextInput()));
text.replace(line, TextInput.getTextInput(), TextInput.getTextInput());
}else { }else {
textOutput.errorInvalidCommand(); textOutput.errorInvalidCommand();
} }