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?
2 ビュー (過去 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!