How to remove single quotes using regexprep
Mostrar comentarios más antiguos
I would like to know how can we eliminate the single quotes in a cell using regexprep. I have a 1x150000 cell array.
4 comentarios
vish
el 9 de Feb. de 2011
Oleg Komarov
el 9 de Feb. de 2011
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
el 9 de Feb. de 2011
Oleg Komarov
el 9 de Feb. de 2011
Then Andrew's code should work fine.
Respuesta aceptada
Más respuestas (2)
David Young
el 9 de Feb. de 2011
The solution using regexprep is just
D = regexprep(C, '''', '');
Lakhan
el 8 de Nov. de 2013
its not working in my case
if true
% code
>> a = {'hi'}
a =
'hi'
>> D = strrep(a, '''', '')
D =
'hi'
end
1 comentario
Walter Roberson
el 8 de Nov. de 2013
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}
Categorías
Más información sobre Dates and Time en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!