Mostrar comentarios más antiguos
how would i write a code to print each line of the string array G omitting any trailing blanks?
Respuestas (2)
Wayne King
el 23 de Mayo de 2012
s = 'Have you tried deblank? '
s1 = deblank(s);
length(s)
length(s1)
G = repmat(strcat(" ",datestr(now,'yyyy/mmm/dd HH:MM:SS')," "),10,1)
fprintf(1,'%s\n',strtrim(G));
Categorías
Más información sobre Characters and Strings 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!