Remove part of the sring

1 回表示 (過去 30 日間)
Kanakaiah Jakkula
Kanakaiah Jakkula 2016 年 1 月 23 日
回答済み: Walter Roberson 2016 年 1 月 23 日
Hi, I have below table, and I want to remove "pr.", "Tv_" from 2nd column. In my table some of the names (in 2nd column) contains _slot1,_slot5. So, I also want to remove if the name match "_slot"(whatever the it may like _slot1,_slot2, _slot5, etc). Please kindly some one help.
Many many Thanks.
E pr.vb004K
F pr.vb023K
D pr.vb013K
E pr.vb010K
A Tv_pr12k_mm_ty004.vg_slot5
G Tv_pr.vf22k_ff01_hy004_slot1

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 1 月 23 日
Aside from the usual manipulations about working with tables, if you have a cell array of strings then
new_cell_string = regexprep(old_cell_string, {'pr\.', 'Tv_', '_slot.*'}, {'', '', ''});

カテゴリ

Help Center および File ExchangeDesign of Experiments (DOE) についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by