Remove a string from another string
古いコメントを表示
I have two strings like 'bio-inspired' and 'bioinspired'. I want to essentially subtract one string from another and get '-' in the end. How can I delete all letters appearing in one string from another string? The erase function doesn't work for this case.
採用された回答
その他の回答 (1 件)
Ezma Nasr
2023 年 2 月 15 日
0 投票
str='bio-inspired';
newStr = erase(str,"-")
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!