- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for CutPrefix (0.05 sec)
-
src/bytes/example_test.go
} func ExampleCutPrefix() { show := func(s, prefix string) { after, found := bytes.CutPrefix([]byte(s), []byte(prefix)) fmt.Printf("CutPrefix(%q, %q) = %q, %v\n", s, prefix, after, found) } show("Gopher", "Go") show("Gopher", "ph") // Output: // CutPrefix("Gopher", "Go") = "pher", true // CutPrefix("Gopher", "ph") = "Gopher", false } func ExampleCutSuffix() { show := func(s, suffix string) {
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Mon May 12 16:07:54 UTC 2025 - 16.5K bytes - Viewed (0) -
src/bytes/bytes.go
} return append([]byte{}, b...) } // CutPrefix returns s without the provided leading prefix byte slice // and reports whether it found the prefix. // If s doesn't start with prefix, CutPrefix returns s, false. // If prefix is the empty byte slice, CutPrefix returns s, true. // // CutPrefix returns slices of the original slice s, not copies. func CutPrefix(s, prefix []byte) (after []byte, found bool) {
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Wed Sep 03 14:04:47 UTC 2025 - 35.5K bytes - Viewed (0) -
src/bytes/bytes_test.go
{"", "d", "", false}, {"", "", "", true}, } func TestCutPrefix(t *testing.T) { for _, tt := range cutPrefixTests { if after, found := CutPrefix([]byte(tt.s), []byte(tt.sep)); string(after) != tt.after || found != tt.found { t.Errorf("CutPrefix(%q, %q) = %q, %v, want %q, %v", tt.s, tt.sep, after, found, tt.after, tt.found) } } } var cutSuffixTests = []struct { s, sep string
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Mon Jul 28 18:13:58 UTC 2025 - 62.9K bytes - Viewed (0) -
cmd/object-handlers.go
versionID = tarHdrs.PAXRecords["minio.versionId"] hdrs = make(http.Header) for k, v := range tarHdrs.PAXRecords { if k == "minio.versionId" { continue } if after, ok0 := strings.CutPrefix(k, "minio.metadata."); ok0 { k = after hdrs.Set(k, v) } } m, err := extractMetadata(ctx, textproto.MIMEHeader(hdrs)) if err != nil { return err }
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Sun Sep 07 16:13:09 UTC 2025 - 120.6K bytes - Viewed (0)