Remove a string from another string
32 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
0 commentaires
Réponse acceptée
KSSV
le 6 Mai 2021
str1 = 'bio-inspired' ;
str2 = 'bioinspired' ;
str=setdiff(str1,str2)
4 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!