www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/SplitStringAtMultipleDelimitersExample.m

    %% Split String at Multiple Delimiters
% Split a string at exclamation points and at space characters.
str = string('A horse! A horse! My kingdom for a horse!')

%%
% |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,{' ','!'})