Problem in displaying a substring
显示 更早的评论
Problem in displaying a substring
Ex: I have this line:-
C:\abc\xyz\myName_1.wav
I want to display only 'myName' from this line
采纳的回答
更多回答(1 个)
Grzegorz Knor
2011-12-30
doc fileparts
doc strfind
2 个评论
Grzegorz Knor
2011-12-30
In your case:
[pathstr, name, ext] = fileparts('C:\abc\xyz\myName_1.wav')
idx = strfind(name,'_')
disp(name(1:idx-1))
Nishat Anjum Shaikh
2011-12-30
类别
在 帮助中心 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!