How to read a string character by character?

1 回表示 (過去 30 日間)
Febin Benjamin
Febin Benjamin 2013 年 8 月 23 日
I have a file name as CCTV03x456x1658.avi. And i want to read only 'CCTV03x456x1658' before the '.avi' and exclude the '.avi part. How can I achieve this?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 8 月 23 日
s='CCTV03x456x1658.avi'
s=s(1:strfind(s,'.')-1)
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 8 月 23 日
%or
s=regexp(s,'[\w\s]+(?=.avi)','match')

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImport, Export, and Conversion についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by