chompsep.m
来自「This contribution provides functions for」· M 代码 · 共 19 行
M
19 行
function str = chompsep(str)
%CHOMPSEP Remove file separator at end of string.
% STR = CHOMPSEP(STR) returns the string STR with the file separator at
% the end of the string removed (if existing).
%
% Example:
% str1 = chompseq('/usr/local/');
% str2 = chompseq('C:\Program Files\');
%
% Markus Buehren
% Last modified 05.04.2009
%
% See also CONCATPATH.
if ~isempty(str) && str(end) == filesep
str(end) = '';
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?