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!