Replacing string by start of this string
1 ビュー (過去 30 日間)
表示 古いコメント
Hello All,
would you be so kind, could you advise me, how can i create condition with 'if', when i need replace all columns start with 'something-some string' by other string. For example, I have CPU type:'AMD Opteron 852 Single Core' and I need to replace it by only 'AMD Opteron'....:) Thank you for your help in advance...:)
0 件のコメント
採用された回答
per isakson
2016 年 1 月 30 日
Hint:
cac = {'AMD','INTEL','ZILOG'
'ZILOG','AMD','INTEL' };
cac = regexprep( cac, '^Z.+$', 'Z80' )
outputs
cac =
'AMD' 'INTEL' 'Z80'
'Z80' 'AMD' 'INTEL'
All strings starting with "Z" are replaced by "Z80"
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!