- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for TrimRight (0.6 sec)
-
src/bytes/bytes_test.go
{"TrimLeft", []byte{'a', 'b'}, "ab", nil}, {"TrimLeft", []byte("☺"), "☺", nil}, {"TrimRight", nil, "", nil}, {"TrimRight", []byte{}, "", []byte{}}, {"TrimRight", []byte{'a'}, "a", []byte{}}, {"TrimRight", []byte{'a', 'a'}, "a", []byte{}}, {"TrimRight", []byte{'a'}, "ab", []byte{}}, {"TrimRight", []byte{'a', 'b'}, "ab", []byte{}}, {"TrimRight", []byte("☺"), "☺", []byte{}}, {"TrimPrefix", nil, "", nil},
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Mon Jul 28 18:13:58 UTC 2025 - 62.9K bytes - Viewed (0) -
src/archive/tar/strconv.go
// in the V7 path field as a directory even though the full path // recorded elsewhere (e.g., via PAX record) contains no trailing slash. if len(s) > len(b) && b[len(b)-1] == '/' { n := len(strings.TrimRight(s[:len(b)-1], "/")) b[n] = 0 // Replace trailing slash with NUL terminator } } // fitsInBase256 reports whether x can be encoded into n bytes using base-256
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Mon Sep 08 17:08:20 UTC 2025 - 9.1K bytes - Viewed (0) -
src/bytes/example_test.go
b = bytes.TrimSuffix(b, []byte("gopher")) b = append(b, bytes.TrimSuffix([]byte("world!"), []byte("x!"))...) os.Stdout.Write(b) // Output: Hello, world! } func ExampleTrimRight() { fmt.Print(string(bytes.TrimRight([]byte("453gopher8257"), "0123456789"))) // Output: // 453gopher } func ExampleTrimRightFunc() { fmt.Println(string(bytes.TrimRightFunc([]byte("go-gopher"), unicode.IsLetter)))
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
} s = s[n:] } if len(s) == 0 { // This is what we've historically done. return nil } return s } // TrimRight returns a subslice of s by slicing off all trailing // UTF-8-encoded code points that are contained in cutset. func TrimRight(s []byte, cutset string) []byte { if len(s) == 0 || cutset == "" { return s } if len(cutset) == 1 && cutset[0] < utf8.RuneSelf {
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Wed Sep 03 14:04:47 UTC 2025 - 35.5K bytes - Viewed (0)