How to remove single quotes using regexprep
古いコメントを表示
I would like to know how can we eliminate the single quotes in a cell using regexprep. I have a 1x150000 cell array.
4 件のコメント
vish
2011 年 2 月 9 日
Oleg Komarov
2011 年 2 月 9 日
Are you sure it's not just the visualization effect when you try to display a cell array of string on the command window.
Ex: a = {'hi'}
vish
2011 年 2 月 9 日
Oleg Komarov
2011 年 2 月 9 日
Then Andrew's code should work fine.
採用された回答
その他の回答 (2 件)
David Young
2011 年 2 月 9 日
The solution using regexprep is just
D = regexprep(C, '''', '');
Lakhan
2013 年 11 月 8 日
its not working in my case
if true
% code
>> a = {'hi'}
a =
'hi'
>> D = strrep(a, '''', '')
D =
'hi'
end
1 件のコメント
Walter Roberson
2013 年 11 月 8 日
Your string does not contain quotation marks. You have created a cell array, and string elements of a cell array are displayed surrounded by quote marks. Look at
a{1}
カテゴリ
ヘルプ センター および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!