If ( result == word ) then return If you don 't want to print last word
cout << " TABSYMBOL " << result << endl ; return ; } wordBreakAll ( root , word . substr ( i , n - i ) , n - i , result + prefix + " ▁ " ) ; } } }