%% Return Token Using Delimiter
% Create a string. Starting in R2017a, you can create strings using double quotes.

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

%
% Return the first part of the string using the '!' character as a delimiter.

token = strtok(str,'!')

% Copyright 2012 The MathWorks, Inc.