⍝ Source vector split into words:

    words 'It''s only words,'               ⍝ Word split at A-Z,a-z,Á-õ.
┌──┬─┬─┬─┬────┬─┬─────┬─┐
│It│'│s│ │only│ │words│,│
└──┴─┴─┴─┴────┴─┴─────┴─┘

    words'4x1+x2'                           ⍝ Trailing 0-9 bind to left.
┌─┬──┬─┬──┐
│4│x1│+│x2│
└─┴──┴─┴──┘

    (lcase ⎕a) words'mete and dole'         ⍝ Simple alphabet split.
┌────┬─┬───┬─┬────┐
│mete│ │and│ │dole│
└────┴─┴───┴─┴────┘

    (lcase ⎕a) words':If ⎕IO=0'             ⍝ Split at a-z.
┌──┬─┬──────┐
│:I│f│ ⎕IO=0│
└──┴─┴──────┘

    (⎕A,lcase ⎕a) words':If ⎕IO=0'          ⍝ Split at A-Z,a-z.
┌─┬──┬──┬──┬──┐
│:│If│ ⎕│IO│=0│
└─┴──┴──┴──┴──┘

    (':⎕',⎕A,lcase ⎕a) words':If ⎕IO=0'     ⍝ Split at :,⎕,A-Z,a-z.
┌───┬─┬───┬──┐
│:If│ │⎕IO│=0│
└───┴─┴───┴──┘

    (⎕D,':⎕',⎕A,lcase ⎕a) words':If ⎕IO=0'  ⍝ Split at 0-9,:,⎕,A-Z,a-z.
┌───┬─┬───┬─┬─┐
│:If│ │⎕IO│=│0│
└───┴─┴───┴─┴─┘

    ⎕A (lcase ⎕a) words 'ThatsAllFolks!'    ⍝ Split at A-Z; a-z trail.
┌─────┬───┬─────┬─┐
│Thats│All│Folks│!│
└─────┴───┴─────┴─┘

    (1 to 10) words 1 0 0 2 3 0 4 5 6       ⍝ Numeric 'alphabet'.
┌─┬───┬───┬─┬─────┐
│1│0 0│2 3│0│4 5 6│
└─┴───┴───┴─┴─────┘

    (1 to 10) 0 words 1 0 0 2 3 0 4 5 6     ⍝ Numeric;  0s trail.
┌─────┬─────┬─────┐
│1 0 0│2 3 0│4 5 6│
└─────┴─────┴─────┘


Back to: code

Back to: Workspaces