%% Split String at Multiple Delimiters
% Create a string. Starting in R2017a, you can create strings using double quotes.

str = "A horse! A horse! My kingdom for a horse!"

%
% Split str at exclamation points and at whitespace characters. newStr is a 10-by-1 string array. The last string is an empty string, "", because the last character in str is a delimiter.

newStr = split(str,[" ","!"])

% Copyright 2012 The MathWorks, Inc.