Filter a cell array with words
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
AA
am 28 Jul. 2019
Beantwortet: Walter Roberson
am 28 Jul. 2019
Hi,
assume you have the cell array{1,1} with a text called "XXXX-adsaads". I want the the portion -adsaads to be removed so that I only get XXXX. How can I do this?
2 Kommentare
Walter Roberson
am 28 Jul. 2019
Is the "adsaads" known ahead of time? Or are you wanting to find the part before the first - ? or are you wanting to find the part before the last - in cases where there are multiple - ?
Akzeptierte Antwort
Walter Roberson
am 28 Jul. 2019
trimedcell = regexprep(YourCellArray, '-.*', '', 'once');
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!