Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for SplitAfterN (0.24 sec)

  1. src/bytes/bytes.go

    //
    // To split around the first instance of a separator, see Cut.
    func SplitN(s, sep []byte, n int) [][]byte { return genSplit(s, sep, 0, n) }
    
    // SplitAfterN slices s into subslices after each instance of sep and
    // returns a slice of those subslices.
    // If sep is empty, SplitAfterN splits after each UTF-8 sequence.
    // The count determines the number of subslices to return:
    //
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  2. src/bytes/example_test.go

    }
    
    func ExampleSplitAfter() {
    	fmt.Printf("%q\n", bytes.SplitAfter([]byte("a,b,c"), []byte(",")))
    	// Output: ["a," "b," "c"]
    }
    
    func ExampleSplitAfterN() {
    	fmt.Printf("%q\n", bytes.SplitAfterN([]byte("a,b,c"), []byte(","), 2))
    	// Output: ["a," "b,c"]
    }
    
    func ExampleTitle() {
    	fmt.Printf("%s", bytes.Title([]byte("her royal highness")))
    	// Output: Her Royal Highness
    }
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  3. src/bytes/bytes_test.go

    	{"1 2", " ", 3, []string{"1 ", "2"}},
    	{"123", "", 2, []string{"1", "23"}},
    	{"123", "", 17, []string{"1", "2", "3"}},
    }
    
    func TestSplitAfter(t *testing.T) {
    	for _, tt := range splitaftertests {
    		a := SplitAfterN([]byte(tt.s), []byte(tt.sep), tt.n)
    
    		// Appending to the results should not change future results.
    		var x []byte
    		for _, v := range a {
    			x = append(v, 'z')
    		}
    
    		result := sliceOfString(a)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Jan 24 16:07:25 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  4. api/go1.txt

    pkg bytes, func Replace([]uint8, []uint8, []uint8, int) []uint8
    pkg bytes, func Runes([]uint8) []int32
    pkg bytes, func Split([]uint8, []uint8) [][]uint8
    pkg bytes, func SplitAfter([]uint8, []uint8) [][]uint8
    pkg bytes, func SplitAfterN([]uint8, []uint8, int) [][]uint8
    pkg bytes, func SplitN([]uint8, []uint8, int) [][]uint8
    pkg bytes, func Title([]uint8) []uint8
    pkg bytes, func ToLower([]uint8) []uint8
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Aug 14 18:58:28 GMT 2013
    - 1.7M bytes
    - Viewed (1)
Back to top