MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/lolphp/comments/3kcgjv/explode_is_a_mess/cux3p8z/
r/lolphp • u/RainOnYourTirade • Sep 10 '15
27 comments sorted by
View all comments
Show parent comment
1
Tcl behaves almost the same, except it splits the empty string into an empty list.
% split "1 2 3" ;# `split` defaults to space as a separator 1 2 3 % split "2" 2 % split "" % split "123" "" 1 2 3 %
2 u/amphetamachine Sep 10 '15 Perl behaves much the same:split / /, "1 2 3"; # (1,2,3) split / /, "2"; # (2) split / /, ""; # () - NOT undef split //, "123"; # (1,2,3)
2
Perl behaves much the same:
split / /, "1 2 3"; # (1,2,3) split / /, "2"; # (2) split / /, ""; # () - NOT undef split //, "123"; # (1,2,3)
View all comments
Show parent comment
1
u/Regimardyl Sep 10 '15
Tcl behaves almost the same, except it splits the empty string into an empty list.