MATLAB: String indexing [A = str(str == ‘e’)] ?

arrayarrayscharchar arrayindexindexingstringstring index

str = 'somebody forgot to do the dishes';
A = str(str == 'e');
Why is the following code output as 'eee'. Shouldn't it be just 'ee'?
Thanks

Best Answer

There are e's in the words "somebody", "the", and "dishes".
Related Question