找到指定字符串位置:
k = strfind(str,pat)
示例:
str = 'Find the starting indices of substrings in a character vector';
k = strfind(str,'in')
k = 1×5
2 15 19 36 41
拆解文件名(除去后缀)
str = filename;
pat = '_';
newStr = extractBefore(str,pat);