%% Find Substrings in Character Vector
% Find the starting indices of substrings in a character vector.
% First, create a character vector.

str = 'Find the starting indices of substrings in a character vector';

%
% Find the substring in.

k = strfind(str,'in')

% There are four instances in str.
%
% Find the substring In.

k = strfind(str,'In')

% Since strfind is case sensitive, the substring is not found. k is an empty array.
%
% Find the blank spaces in str.

k = strfind(str,' ')

% There are ten blank spaces in str.
% Copyright 2012-2020 The MathWorks, Inc.