title: SASS function to split strings is only splitting on first occurrence
body: <p>From the answer at <a href="https://stackoverflow.com/a/52375669/1427563">https://stackoverflow.com/a/52375669/1427563</a> I used the following recursive SASS function to split a string into a list of substrings, given a separator. Eg calling <code>str-split( &quot;0 0 0 0&quot;, &quot; &quot;);</code> should return the list <code>(&quot;0&quot;,&quot;0&quot;,&quot;0&quot;,&quot;0&quot;)</code>.</p>
  <pre><code>@function str-split( $string, $separator: &quot; &quot; ) {
      $i: str-index( $string, $separator );
      @if $i != null {
          @return append(
                str-slice( $string, 1, $i - 1 ),
                str-split( str-slice( $string, $i + str-length( $separator ) ), $separator )
          );
      }
      @return $string;
  }
  </code></pre>
  <p>However calling the function with string <code>&quot;0 0 0 0&quot;</code> and separator <code>&quot; &quot;</code> returns the list <code>(&quot;0&quot;, &quot;0 0 0&quot;)</code>. This can be tested by checking the length of the returned array.</p>
  <pre><code>$sides_arr: str-split( &quot;0 0 0 0&quot;, &quot; &quot; );
  @debug length( $sides_arr );
  </code></pre>
  <pre class="lang-sh prettyprint-override"><code>&gt; _2-mixins.scss:63 DEBUG: 2
  </code></pre>
  <p>The recursive call should ensure that the string is split at all occurrences. Why is the function <code>str-split</code> only splitting on the first occurrence of the separator?</p>