strrep for unordered string

1 次查看(过去 30 天)
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.

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by