Remove a string from another string
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
Ezma Nasr
am 15 Feb. 2023
0 Stimmen
str='bio-inspired';
newStr = erase(str,"-")
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!