Is there an efficient method to remove leading underscores from a cell array of strings?
30 次查看(过去 30 天)
显示 更早的评论
Given
a={'rose','_tulip_blue','lilac','_daisy'}
is there an efficient way of stripping the leading underscores to give
b={'rose','tulip_blue','lilac','daisy'}
I tried
strtok(a,'_')
but that gives
b={'rose','tulip','lilac','daisy'}
and misses the '_blue'. I would like to avoid looping through the strings one at a time if possible.
0 个评论
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!