Skip to content

2014-4: Space The Final Frontier

Write a dfn that removes extraneous (leading, trailing, and multiple) spaces from a character vector.

Examples:

      (your_function) '  this  is a   test  '
this is a test
       (your_function) '' ⍝ should return an empty vector

       (your_function) 'hello world!'
hello world!
       (your_function) '  ' ⍝ vector of only spaces should return empty vector
your_function ←

Solutions

Video Thumbnail YouTube

Chat transcript Code on GitHub