how can I eliminate space between characters of a string?
12 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Guillaume
2015-5-11
s = 't P t P t P t P t P t P t P t P t P t';
%option 1, strrep:
s1 = strrep(s, ' ', '')
%option 2, comparison and deletion
s2 = s; s2(s2 == ' ') = []
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!