フィルターのクリア

How do I extract a portion of a string after a prescribed symbol?

2 ビュー (過去 30 日間)
Paul Fishback
Paul Fishback 2017 年 6 月 14 日
コメント済み: Paul Fishback 2017 年 6 月 14 日
I have a string of the form
mystring='C\users\me\data\mymatrix.mat'
What operation will permit me to create the string consisting of all characters before the last '\'. In other words, what operation will yield the string
'C\users\me\data' ?
Perhaps the command strsplit could be used in some manner?

採用された回答

Stephen23
Stephen23 2017 年 6 月 14 日
編集済み: Stephen23 2017 年 6 月 14 日
>> fileparts(mystring)
ans =
C\users\me\data

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by