Implementation
Dart

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
String[] chunks = s.split("\\s+");
import "strings"
chunks := strings.Split(s, " ")
chunks = s.split()
$chunks = preg_split("/ +/", $s);
@chunks = split /\s+/, $s;
var chunks = s.split(/ +/);
let chunks:Vec<_>=s.split_whitespace().collect();
import std.range;
auto chunks = s.splitter;
Uses Classes;
chunks.StrictDelimiter := True;
chunks.Delimiter := ' ';
chunks.DelimitedText := s;
chunks = s.split
chunks = String.split(s)
chunks = words s
Chunks = string:tokens(S, [$\s]).
import "strings"
chunks := strings.Fields(s)
chunks = {}
for substring in s:gmatch("%S+") do
   table.insert(chunks, substring)
end
#include <string.h>
chunks[0] = strtok(s, " ");
for (int i = 1; i < N; ++i)
{
    chunks[i] = strtok(NULL, " ");
    
    if (!chunks[i])
        break;
}
(define (tokenize l)
  (let loop ((t '())
             (l l))
    (if (pair? l)
        (let ((c (car l)))
          (if (char=? c #\space)
              (cons (reverse t) (loop '() (cdr l)))
              (loop (cons (car l) t) (cdr l))))
        (if (null? t)
            '()
            (list (reverse t))))))

(define (string-split s)
  (map list->string (tokenize (string->list s))))