I am using R2018b, and trying to use the function 'validtaestring', but it doesn't find a partial match. Has anyone tried that in this version?
조회 수: 1 (최근 30일)
이전 댓글 표시
채택된 답변
Guy Nir
2018년 11월 20일
댓글 수: 2
Image Analyst
2018년 11월 20일
strfind returns an index or an empty null string.
You might want to use contains() like I did in my answer, unless you really need to know the index where the substring starts. If you have just one item, like you did, then you can also use strcmp() or ismember().
추가 답변 (1개)
Image Analyst
2018년 11월 20일
To find partial matches, don't use validatestring(). Use contains
validString = contains(str, STR2);
참고 항목
카테고리
Help Center 및 File Exchange에서 Argument Definitions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!