Contents Previous Next Subchapters

Remove Leading and Trailing Spaces
Syntax clipstr(text)
See Also strclip , strreplace , findstr , align

Description
Returns a copy of the character matrix text with leading and trailing spaces removed. The return value is a character matrix with the same row dimension as text.

Example
If you enter
     setprint("continue", true)
     x = " 1 "
     x
O-Matrix will respond
      " 1 "
If you then enter
     x = clipstr(x)
     x
O-Matrix will respond
     "1"
     
You can use clipstr with a matrix that has more than one row. If you continue the example above by entering
     x = { " one", " four" }
     x
O-Matrix will respond
     { ...
     " one ", ...
     " four" ...
     }
If you then enter
     x = clipstr(x)
     x
O-Matrix will respond
     { ...
     " one", ...
     "four" ...
     }
You can return O-Matrix to its default printing mode by entering the command
     setprint("continue", false)