- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 31 for SplitN (0.21 sec)
-
src/bytes/bytes.go
return genSplit(s, sep, len(sep), n) } // Split slices s into all subslices separated by sep and returns a slice of // the subslices between those separators. // If sep is empty, Split splits after each UTF-8 sequence. // It is equivalent to SplitN with a count of -1. // // To split around the first instance of a separator, see Cut. func Split(s, sep []byte) [][]byte { return genSplit(s, sep, 0, -1) }
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
// U+0068 'h' // U+0065 'e' // U+0072 'r' } func ExampleSplit() { fmt.Printf("%q\n", bytes.Split([]byte("a,b,c"), []byte(","))) fmt.Printf("%q\n", bytes.Split([]byte("a man a plan a canal panama"), []byte("a "))) fmt.Printf("%q\n", bytes.Split([]byte(" xyz "), []byte(""))) fmt.Printf("%q\n", bytes.Split([]byte(""), []byte("Bernardo O'Higgins"))) // Output: // ["a" "b" "c"] // ["" "man " "plan " "canal panama"]
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
} s := Join(a, []byte(tt.sep)) if string(s) != tt.s { t.Errorf(`Join(Split(%q, %q, %d), %q) = %q`, tt.s, tt.sep, tt.n, tt.sep, s) } if tt.n < 0 { b := Split([]byte(tt.s), []byte(tt.sep)) if !reflect.DeepEqual(a, b) { t.Errorf("Split disagrees withSplitN(%q, %q, %d) = %v; want %v", tt.s, tt.sep, tt.n, b, a) } } if len(a) > 0 { in, out := a[0], s
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) -
src/cmd/asm/internal/asm/pseudo_test.go
package asm import ( "strings" "testing" "cmd/asm/internal/lex" ) func tokenize(s string) [][]lex.Token { res := [][]lex.Token{} if len(s) == 0 { return res } for _, o := range strings.Split(s, ",") { res = append(res, lex.Tokenize(o)) } return res } func TestErroneous(t *testing.T) { type errtest struct { pseudo string operands string expected string }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Aug 29 07:48:38 GMT 2023 - 3.1K bytes - Viewed (0) -
src/cmd/cgo/internal/swig/swig_test.go
// Ask the go tool for the CXX it's configured to use. cxx, err := exec.Command("go", "env", "CXX").CombinedOutput() if err != nil { t.Fatalf("go env CXX failed: %s", err) } args, err := quoted.Split(string(cxx)) if err != nil { t.Skipf("could not parse 'go env CXX' output %q: %s", string(cxx), err) } if len(args) == 0 { t.Skip("no C++ compiler") } testenv.MustHaveExecPath(t, string(args[0])) }
Go - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Fri May 12 12:00:07 GMT 2023 - 3.7K bytes - Viewed (0) -
src/cmd/api/api_test.go
fmt.Fprintf(f, "%s\n", feat) } f.Close() } bs, err := os.ReadFile(goldenFile) if err != nil { t.Fatalf("opening golden.txt for package %q: %v", fi.Name(), err) } wanted := strings.Split(string(bs), "\n") sort.Strings(wanted) for _, feature := range wanted { if feature == "" { continue } _, ok := w.features[feature] if !ok {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Thu Jan 04 17:31:12 GMT 2024 - 7.1K bytes - Viewed (0) -
misc/go_android_exec/main.go
if err != nil { if ee, ok := err.(*exec.ExitError); ok && len(ee.Stderr) > 0 { return errorf("%v: %s", cmd, ee.Stderr) } return errorf("%v: %w", cmd, err) } parts := strings.SplitN(string(bytes.TrimSpace(out)), ":", 4) if len(parts) < 2 { return errorf("%v: missing ':' in output: %q", cmd, out) } importPath = parts[0] if importPath == "" || importPath == "." {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Mon Aug 21 17:46:57 GMT 2023 - 15.3K bytes - Viewed (0) -
src/cmd/cgo/doc.go
host object files found in package archives to that directory (renamed to avoid conflicts), write the go.o file to that directory, and invoke the host linker. The default value for the host linker is $CC, split into fields, or else "gcc". The specific host linker command line can be overridden using command line flags: cmd/link -extld=clang -extldflags='-ggdb -O3'. If any package in a build includes a .cc or
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Sun Mar 31 09:02:45 GMT 2024 - 42.1K bytes - Viewed (0) -
src/cmd/cgo/internal/test/callback.go
// We do not do any explicit checks, just ensure that it does not crash. for _, f := range splitTests { f() } } //export goStackCheck func goStackCheck() { // use some stack memory to trigger split stack check var buf [256]byte use(buf[:]) } var Used byte func use(buf []byte) { for _, c := range buf { Used += c } } var splitTests = []func(){
Go - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Fri May 12 12:00:02 GMT 2023 - 111.5K bytes - Viewed (0) -
doc/go1.17_spec.html
assigned the return values of <code>g</code> that remain after assignment of regular parameters. </p> <pre> func Split(s string, pos int) (string, string) { return s[0:pos], s[pos:] } func Join(s, t string) string { return s + t } if Join(Split(value, len(value)/2)) != value { log.Panic("test fails") } </pre> <p>
HTML - Registered: Tue May 07 11:14:38 GMT 2024 - Last Modified: Thu Apr 11 20:22:45 GMT 2024 - 211.6K bytes - Viewed (0)