strtrim
- :
s =strtrim(s)¶ Strip blanks from both ends of text.
Whitespace at the start and end of s is removed. For a character matrix the columns that are blank in every row are dropped, so all rows keep the same length. A cell array is processed element by element, descending into nested cells.
strtrim (" hello world ") ⇒ "hello world" strtrim ([' ab '; ' cde ']) ⇒ [" ab"; "cde"]