strrep for unordered string

조회 수: 1 (최근 30일)
Reuben Addison
Reuben Addison 2020년 2월 5일
댓글: Stephen23 2020년 2월 5일
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에서 Variables에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by