strtrim
Remove leading and trailing whitespace from strings
Syntax
Description
newStr = strtrim(
removes leading and trailing
whitespace characters from str
)str
and returns the result as
newStr
. However, strtrim
does not remove
significant whitespace characters. For example, strtrim
removes
leading and trailing space and tab characters, but does not remove the nonbreaking
space character, char(160)
.
Examples
Input Arguments
Algorithms
strtrim
does not remove significant whitespace
characters.
This table shows the most common characters that are significant whitespace characters and their descriptions. For more information, see Whitespace character.
Significant Whitespace Character | Description |
---|---|
| Next line |
| Nonbreaking space |
| Figure space |
| Narrow no-break space |
Extended Capabilities
Version History
Introduced before R2006a