wordsChange);
}
else{
System.out.printf(“”Your new sentence is: %snn””

n Java,

Please help with the bolded section and add the buffer to the other boolean transformString methods below.

import java.util.Scanner;

public class Lab {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
String original;
String command;
char charsChange;
String wordsChange;
char replaceThis;
String replaceThisWord;
char charsReplace;
String wordsReplace;
char withThis;
String withThisWord;
String transform;
int replaceHere;
int replaceWordHere;

System.out.printf(“nYou can perform the following operations:n” +
“Replace chars: replace all occurrences of a character another charactern”+
“Replace words: replace all occurrences of one word with another wordn”+
“Replace char: replace a specific occurrence of a charactern”+
“Replace word: replace a specific occurrence of a wordn”+
“Undo: Undo the last operationn” + “Redo: Redo the most recent undone operationn” +
“Reset: Reset to the intitial stringn”+
“Quitnn”);

System.out.printf(“Enter a string to be transformed: “);
original = scnr.nextLine();
Editor m = new Editor(original);
System.out.println();

do{
System.out.printf(“Enter your command: “);
command = scnr.nextLine();
if(command.equalsIgnoreCase(“Quit”)){
break;
}
else if(command.equalsIgnoreCase(“Replace words”)){
System.out.printf(“Enter the word to replace: “);
wordsChange = scnr.nextLine();
System.out.printf(“Enter the replacement word: “);
wordsReplace = scnr.nextLine();
if(m.transformString(wordsChange, wordsReplace) == false){
System.out.printf(“Error, “%s”” is not in the stringn””