MATLAB字符串分解, 合并

% 分解
% regexp
s = 'ab/c/d.png'
file_name = regexp(s, '/', 'split');    % 'd.png'
% split
fractions = split('a0_b1_c2', '_');
b1 = fractions{2};    % 'b1'

% 拼接
% strcat
s = strcat('a', 'b');    % 'ab'
% []
best_band_ever = ['TheSt', 'oneRoses'];    % 'TheStoneRoses'

% 路径拼接
s = fullfile('a', 'b');    % 'a\\b'

posted @ 2018-02-27 01:30  默盒  阅读(1366)  评论(0编辑  收藏  举报