필터 지우기
필터 지우기

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 CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by