strncmp comparing two segments of the same string
1 次查看(过去 30 天)
显示 更早的评论
I have the following 2*1 cell array -
aa =
{'L['string',1]'}
{'L['string',2']}
I would like to do strncmp using 'L[' and ',1' characters so that the first cell result will show 1 and the second will show 0. I would appreciate any direction on this.
0 个评论
采纳的回答
Image Analyst
2020-3-5
Try contains(aa, 'L[') and contains(aa, '1'). Attach your aa in a .mat file if you need more help.
0 个评论
更多回答(0 个)
另请参阅
类别
在 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!