strrep for unordered string

7 visualizzazioni (ultimi 30 giorni)
Reuben Addison
Reuben Addison il 5 Feb 2020
Commentato: Stephen23 il 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.

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Tag

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by