Function splitExpression

  • Splits given string by spaces (even if multiple).

    Example

    splitExpression("  1  2   3    4     5 "); // ["1", "2", "3", "4", "5"]
    splitExpression("1 2 3 4 5"); // ["1", "2", "3", "4", "5"]
    splitExpression("12345"); // ["12345"]

    Returns

    An array with all elements of the given expression.

    Parameters

    • source: string

      string to be parsed.

    Returns string[]