Removing multiple substrings in a string
이전 댓글 표시
I have a string like this
String = 'AAAAAAAAAbbbbbbbbbbbbbbbbCCCCCCCCCCCCCCCCCddddddddddddddddddEEEEEEEEEEEE';
% I want to remove all the lowercase letters so I need some indexes to do it
[Start,End]=regexp(String,'[a-z]{1,}');
%Here it comes the problem
I do not know how to remove multiple substring from the same string. eraseBetween provide a way to index a substring but how to remove multiple ones?
Thank you in advance
채택된 답변
추가 답변 (1개)
madhan ravi
2020년 7월 20일
regexprep(String, '[a-z]*', '')
댓글 수: 4
Andrea Cappannini
2020년 7월 20일
madhan ravi
2020년 7월 20일
Why touch your nose around the head instead of touching it directly?
Andrea Cappannini
2020년 7월 20일
madhan ravi
2020년 7월 20일
You’re a funny guy xD.
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!