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!