Solution Comments

Hi all, I just can't find out why the assertion fails. All works well on my MALTAB but not here. Both codes (commented and not) remove only the words which end with 'ain' and leave the two spaces but still the assertions here has failed.

Actually this code won't pass the Test Suite on any version of MATLAB. The misunderstanding is caused by rendering of HTML text on Cody, which means that double-spaces are not _displayed_ in the Test Suite's solutions; nevertheless, the correct solutions do contain double spaces, as you can confirm by viewing the HTML source, and as also explained in the problem statement. Your code is removing some spaces. I'm sure you can fix it now, with this knowledge.

Hi harish, so the if you see the regexprep documentation, it will tell you when you execute, it will remove every word which contains the letters ain in the expression. You can verify this on your system. To solve this, you need to look for a way to use regexprep such that it only looks for the letters in the end of the word.