在文档中寻找特定字符时出现重叠情况,如何避免?。

在一个文档中寻找‘0 0 0 0 0 0’字符,属于结束特殊字符串,但是文档中会出现0 0 0 0 0 0 0(7个或更多)如图:
如果使用strfind,会出现重叠的情况,比如7个0,其第一个0出现在66,在寻找特定字符串时就会显示66和68,达不到目的,对于这种以及其他更多0的情况如何实现“ 同时处理 ”,避免重叠的情况?

 Akzeptierte Antwort

potson
potson am 16 Mai 2023

0 Stimmen

试一下正则表达式吧,链接如下:

Weitere Antworten (0)

Kategorien

Tags

Gefragt:

am 16 Mai 2023

Beantwortet:

am 16 Mai 2023

Community Treasure Hunt

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

Start Hunting!