regexp qwestion

1 vue (au cours des 30 derniers jours)
Raldi
Raldi le 2 Déc 2011
Hi everyone
i have an exprecion of the type numstrscheck = regexp(TheString, '-?\d+\.?\d*', 'match');
is there a way that alongside with any other operations that are done inside regexp, to also substitute the letter s of 'TheString' if it has any, with the number one?

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 2 Déc 2011
TheString = 'gftr dsrew mkjghfdfsde'
out = regexprep(TheString,'s','1')
  1 commentaire
Raldi
Raldi le 2 Déc 2011
Thanks Andrei

Connectez-vous pour commenter.

Plus de réponses (0)

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