Replace characters in strings that meet a condition
古いコメントを表示
I have a 1x5 string array:
myStrings = [ "HH RBPMS", "HH RBPMS", "HH SCGN", "HH RBPMS", "HH ChAT" ];
I would like to replace the characters "HH" with the characters "CT" in the strings which contain the characters "ChAT".
It seems that this should be a simple problem with a simple answer, but it's causing me misery:
contains(myStrings, 'ChAT")
returns a logical array, but I can't see how to use that array to do the replace operation on all the strings in the array.
With apologies for my dim-wittedness and thanks for any suggestions,
Paul Martin
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!