I need to fix this function.
Basically, im printing out a phrase like this: ” e x a m p le”
But its printing an extra space at the end like this: “e x a m pl e “
I need to get rid of the space at the end.
This is the note I have to fix it but I cant figure it out.
For phraseWithBlanks(), you need to change your for loop to havean index variable. That way you can only add a ” ” to the string ifyou are not at the end:
if (index + 1 < phrases.length())
{
// adds a space
OR
OR