Question: On some old Unix terminals, pressing the Backspace (delete) key generates the character sequence AH (Control-H) to delete the previously-typed character. Some people use this


On some old Unix terminals, pressing the Backspace (delete) key generates the character sequence AH (Control-H) to delete the previously-typed character. Some people use this for sarcastic effect when writing, to pretend that they are deleting or replacing some insulting comment Be nice to this foolHAHAHHgentleman, he's visiting from corporate HQ. Define a Java method named backspace() that takes a single String argument. This method returns a new String where each "AH" sequence from the argument has been removed and applied to the non-Backspace character immediately preceding the "AH". For example, given the input above, the program would produce the output: Be nice to this gentleman, he's visiting from corporate HQ. where each "AH" is missing and has effectively erased a preceding character from "fool". Your program should only perform erasures for a full "H" character digram; other
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
