replacement for findstr

11 vues (au cours des 30 derniers jours)
G
G le 25 Août 2011
findstr('text', guidata.dataFile{1,1}.header{i})
header{i} is a 1x4 char (in this example named text)
I have a loop that dynamically generates radio button position and color based on a header row. What I have now works fine but because findstr seems to be on the chopping block I am trying to update the code. I have tried strncmp and regexp but can't seem to figure it out.
Any help is appreciated.

Réponses (1)

Jan
Jan le 25 Août 2011
Do your mean STRFIND?
  9 commentaires
Jan
Jan le 25 Août 2011
FINDSTR had the risky feature that the shorter string is searched in the longer one. If you want to look for the position of 'one' inside 'stone', the reply of FINDSTR will be surprising, if the 2nd string is 'e'.
MATLAB 2009a still ontained several dangerous FINDSTR calls. Perhaps they are replaced by STRFIND now, which searches the 2nd string inside the first one.
Jan
Jan le 25 Août 2011
FINDSTR had the risky feature that the shorter string is searched in the longer one. If you want to look for the position of 'one' inside 'stone', the reply of FINDSTR will be surprising, if the 2nd string is 'e'.
MATLAB 2009a still ontained several dangerous FINDSTR calls. Perhaps they are replaced by STRFIND now, which searches the 2nd string inside the first one.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by