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!