FUNCTION REFERENCE

strtrim

Remove spaces at both ends of text.

Remove spaces at both ends of text.

Syntax

s = strtrim(s)

Syntax

c = strtrim(c)

Removes leading and trailing Unicode whitespace. Significant whitespace is kept: char(133), char(160), char(8199) and char(8239). A cell array of text gives a cell array.

Example

strtrim('  ab c  ')   % 'ab c'

Differences from MATLAB: Character matrices are not supported yet.

String inputs are supported with bounded two-dimensional storage.

Example

strtrim([" a " " b "])

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.