Created
July 1, 2017 11:30
-
-
Save narqo/fa7394f127004b964f7da42ffe604388 to your computer and use it in GitHub Desktop.
How string's split works across the languages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% node -p '",,,1,,,".split(",")' | |
< [ '', '', '', '1', '', '', '' ] | |
% python -c 'a = ",,,1,,,".split(","); print(a);' | |
< ['', '', '', '1', '', '', ''] | |
//go | |
import ("log"; "strings") | |
a := strings.Split(",,,1,,,", ",") | |
log.Printf("%q", a) | |
< ["" "" "" "1" "" "" ""] | |
% perl -e 'use Data::Dumper; my $a = [ split(",", ",,,1,,,") ] ; print Dumper $a' | |
< $VAR1 = ['', '', '', '1']; // because FUCK YOU! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment