I read how to simulate tree structures in MongoDB and came across in this article , which illustrates a comma-separated path line. In the example, the line starts with a comma, and I was wondering if there was a reason or benefit for this, associated with just a comma after each item in the list?
I marked this post as specific to RegEx, in Java I would not want the comma to start, because I would parse the string in the array using ...
String[] array = string.split(",");
... and in PHP I would use ...
$array = explode(",", $string);
In either of these cases, the beginning of a semicolon will result in an empty string in $array[0].
Thanks in advance!
source
share