trim, trim all
Trims excess white spaces (including tabs, new line symbols and other invisible control characters) from the beginning and end of the string.
trim trims excessive spaces from beginning and ends, but leave spaces inside the string untouched.
trim all also removes redundant white blanks inside the string and replaces them by single spaces. I.e. new line symbols are also replaced by spaces.
Non-break space symbols are not affected.
Indirect parameter passing is disabled
1
No. | Type | Description |
---|---|---|
1 input |
string | input string String to be trimmed |
Type | Description |
---|---|
string | trimmed string Excess white spaces removed according to function chosen |
echo( '"', trim ( " This is a green cat "), '"' );
echo( '"', trim all( " This is a green cat "), '"' );
"This is a green cat"
"This is a green cat"