Because the default scala split function accepts regex as well and we don’t like it.


On 10 Feb 2014, at 16:18, Andres Taylor <notifications@github.com> wrote:

> In community/cypher/cypher-compiler-2.0/src/main/scala/org/neo4j/cypher/internal/compiler/v2_0/commands/expressions/StringFunctions.scala:
> 
> > +  def compute(value: Any, m: ExecutionContext)(implicit state: QueryState): Any = {
> > +    val origVal = asString(orig(m))
> > +    val splitPatternVal = asString(splitPattern(m))
> > +
> > +    if (origVal == null || splitPatternVal == null) {
> > +      null
> > +    } else {
> > +      if (splitPatternVal.length > 0) {
> > +        split(origVal, splitPatternVal)
> > +      } else {
> > +        throw new IllegalArgumentException("The split pattern must not be an empty string")
> > +      }
> > +    }
> > +  }
> > +
> > +  private def split(orig: String, splitPattern: String): Seq[String] = {
> Why not use the Scala split function on strings?
> 
> —
> Reply to this email directly or view it on GitHub.
>