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.
Implementation edit is for fixing errors and enhancing with metadata.
Instead of changing the code of the snippet, consider creating another C implementation.
String[] chunks = s.split("\\s+");
chunks = s.split()
$chunks = preg_split('/ +/', $s);
@chunks = split /\s+/, $s;
let chunks = s.split(/ +/);
let chunks:Vec<_> = s.split_whitespace().collect();
s.split(new RegExp('\\s+'))
chunks = s.split
chunks = String.split(s)
chunks = words s
Chunks = string:tokens(S, [$\s]).
chunks = {} for substring in s:gmatch("%S+") do table.insert(chunks, substring) end
(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))))
string[] chunks = s.Split(' ');
val chunks = s.split(" ")
program main use stringifor_string_t ! https://github.com/szaghi/StringiFor implicit none type( string ) :: string1 type( string ), allocatable :: substrings( : ) integer :: i string1 = " Build list _chunks consisting in substrings of input string _s separated by one or more space characters" call string1%split(sep=' ', tokens=substrings ) do i=1,size(substrings, dim=1) write(*,*) substrings(i) enddo end program main
def chunks = s.split(/\s+/)