delete an element from string
Ältere Kommentare anzeigen
hi
I have this string:
str = ["a" "b" "c"]
which gives:
"a" "b" "c"
how can I have this new string with the previouse one:
new_str = "a" "c"
in other words, I want to delete "b" completely.
I have tried erase but with that I will have:
"a" "" "c"
thanks in advance.
Akzeptierte Antwort
Weitere Antworten (1)
str = ["a" "b" "c"];
y= find(contains(str,"b"))
str(y) = []
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!