regexp qwestion

1 Ansicht (letzte 30 Tage)
Raldi
Raldi am 2 Dez. 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?

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 2 Dez. 2011
TheString = 'gftr dsrew mkjghfdfsde'
out = regexprep(TheString,'s','1')
  1 Kommentar
Raldi
Raldi am 2 Dez. 2011
Thanks Andrei

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by