regexp qwestion

1 次查看(过去 30 天)
Raldi
Raldi 2011-12-2
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?

采纳的回答

Andrei Bobrov
Andrei Bobrov 2011-12-2
TheString = 'gftr dsrew mkjghfdfsde'
out = regexprep(TheString,'s','1')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by