strrep for unordered string

1 Ansicht (letzte 30 Tage)
Reuben Addison
Reuben Addison am 5 Feb. 2020
Kommentiert: Stephen23 am 5 Feb. 2020
I have a string 'Z06IL202RNP302' I want to take out 'Z', 'IL' and 'RNP', how do I use strrep to achieve that. Do I do it multiple times.

Akzeptierte Antwort

Bhaskar R
Bhaskar R am 5 Feb. 2020
What about reguler expression?
result = regexprep('Z06IL202RNP302', '(Z|IL|RNP)', '');

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by