Skip to content

clean

Remove non-printable characters from a string.

v = clean(text)

Strips ASCII control characters (codes 0–31) from text. Useful for cleaning data imported from external sources that contain stray newlines, tabs, or other control codes.

clean(['hello' char(9) 'world']) % 'helloworld'
  • strtrim — Remove leading and trailing whitespace from a string.
  • trim