Skip to content

Instantly share code, notes, and snippets.

@ykws
Created October 31, 2016 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ykws/388ad9f62de41093d14d0ab02723f466 to your computer and use it in GitHub Desktop.
Save ykws/388ad9f62de41093d14d0ab02723f466 to your computer and use it in GitHub Desktop.
String#split return arrays with empty values
String str = ",,,";
String[] arrays = str.split(",", -1);
# arrays => ["", "", "", ""]
# arrays.length => 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment