Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for SplitAfterSeq (0.08 sec)

  1. src/bytes/iter.go

    	return splitSeq(s, sep, 0)
    }
    
    // SplitAfterSeq returns an iterator over subslices of s split after each instance of sep.
    // The iterator yields the same subslices that would be returned by [SplitAfter](s, sep),
    // but without constructing a new slice containing the subslices.
    // It returns a single-use iterator.
    func SplitAfterSeq(s, sep []byte) iter.Seq[[]byte] {
    	return splitSeq(s, sep, len(sep))
    }
    
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Wed Sep 03 14:04:47 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  2. src/bytes/bytes_test.go

    			t.Errorf(`Split(%q, %q, %d) = %v; want %v`, tt.s, tt.sep, tt.n, result, tt.a)
    			continue
    		}
    
    		if tt.n < 0 {
    			b := sliceOfString(slices.Collect(SplitAfterSeq([]byte(tt.s), []byte(tt.sep))))
    			if !slices.Equal(b, tt.a) {
    				t.Errorf(`collect(SplitAfterSeq(%q, %q)) = %v; want %v`, tt.s, tt.sep, b, tt.a)
    			}
    		}
    
    		if want := tt.a[len(tt.a)-1] + "z"; string(x) != want {
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Mon Jul 28 18:13:58 UTC 2025
    - 62.9K bytes
    - Viewed (0)
Back to top