Here what the program is expectiong as the output: if originalString = "CATCATICATAMCATCATGREATCATCAT"; Output should be "I AM GREAT". The code must find the sequence of characters (CAT in this case), and remove them. Plus, the resulting String must have spaces in between words.
String origString = remixString.replace("CAT", "");
I figured out I have to use String.replace, But what could be the logic for finding out if its not cat and producing the resulting string with spaces in between the words.
replaceAll()andtrim()