Remove a string from another string
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (1)
Ezma Nasr
el 15 de Feb. de 2023
0 votos
str='bio-inspired';
newStr = erase(str,"-")
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!