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!