📄 split.m
字号:
function l = split(d,s)
%L=SPLIT(S,D) splits a string S delimited by characters in D. Meant to
% work roughly like the PERL split function (but without any
% regular expression support). Internally uses STRTOK to do
% the splitting. Returns a cell array of strings.
%
%Example:
% >> split('_/', 'this_is___a_/_string/_//')
% ans =
% 'this' 'is' 'a' 'string' []
%
%Written by Gerald Dalley (dalleyg@mit.edu), 2004
l = {};
while ~isempty(s)
[t,s] = strtok(s,d); %#ok<STTOK> -- textscan isn't powerful enough
l = {l{:}, t};
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -