MATLAB: How to select specific letters in a name

How could I get MatLab to select specific letters from a name and count them. Say I wanted to select all the s' in (Savannah's new snowmobile). There are 3 s' in it, how would I select and add them together?

Best Answer

>> str = 'Savannah''s new snowmobile';
Method one: logical comparison:
>> nnz('s'==lower(str))
ans = 3
Method two: regexpi:
>> numel(regexpi(str,'s'))
ans = 3
Method three: strfind:
>> numel(strfind(lower(str),'s'))
ans = 3