- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for SplitAfterN (0.15 sec)
-
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 30 11:13:12 GMT 2024 - Last Modified: Mon Feb 19 19:51:15 GMT 2024 - 33.8K bytes - Viewed (0) -
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 30 11:13:12 GMT 2024 - Last Modified: Mon Mar 04 15:54:40 GMT 2024 - 15K bytes - Viewed (1) -
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 30 11:13:12 GMT 2024 - Last Modified: Wed Jan 24 16:07:25 GMT 2024 - 56.2K bytes - Viewed (0)