MATLAB Answers

Extracing the part of the string from cell array

1 view (last 30 days)
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan on 25 Jun 2018
Commented: Paolo on 25 Jun 2018
I have a cell array a = {'abc__first__element' ; 'def__second__element'; ghi__third__element'}
I want to extract the string after first '__'
My final answer should be a = {'first__element'; 'second__element'; 'third__element'}
How can do this?
Thanks a lot

Accepted Answer

Paolo
Paolo on 25 Jun 2018
regexp(a,'(?<=__)(.*)','match')
  2 Comments
Paolo
Paolo on 25 Jun 2018
Good point! Would +1 your comment if that was a thing.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!