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

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

 Respuesta aceptada

potson
potson el 16 de Mayo de 2023

0 votos

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

Más respuestas (0)

Categorías

Más información sobre 字符和字符串 en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 16 de Mayo de 2023

Respondida:

el 16 de Mayo de 2023

Community Treasure Hunt

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

Start Hunting!