Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for TrimRightFunc (0.22 sec)

  1. src/bytes/example_test.go

    	// Output:
    	// 453gopher
    }
    
    func ExampleTrimRightFunc() {
    	fmt.Println(string(bytes.TrimRightFunc([]byte("go-gopher"), unicode.IsLetter)))
    	fmt.Println(string(bytes.TrimRightFunc([]byte("go-gopher!"), unicode.IsPunct)))
    	fmt.Println(string(bytes.TrimRightFunc([]byte("1234go-gopher!567"), unicode.IsNumber)))
    	// Output:
    	// go-
    	// go-gopher
    	// 1234go-gopher!
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  2. src/bytes/bytes.go

    func TrimLeftFunc(s []byte, f func(r rune) bool) []byte {
    	i := indexFunc(s, f, false)
    	if i == -1 {
    		return nil
    	}
    	return s[i:]
    }
    
    // TrimRightFunc returns a subslice of s by slicing off all trailing
    // UTF-8-encoded code points c that satisfy f(c).
    func TrimRightFunc(s []byte, f func(r rune) bool) []byte {
    	i := lastIndexFunc(s, f, false)
    	if i >= 0 && s[i] >= utf8.RuneSelf {
    		_, wid := utf8.DecodeRune(s[i:])
    		i += wid
    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)
  3. src/bytes/bytes_test.go

    			name string
    			trim func(s []byte, f func(r rune) bool) []byte
    			out  []byte
    		}{
    			{"TrimFunc", TrimFunc, tc.trimOut},
    			{"TrimLeftFunc", TrimLeftFunc, tc.leftOut},
    			{"TrimRightFunc", TrimRightFunc, tc.rightOut},
    		}
    		for _, trimmer := range trimmers {
    			actual := trimmer.trim([]byte(tc.in), tc.f.f)
    			if actual == nil && trimmer.out != nil {
    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)
  4. api/go1.txt

    pkg bytes, func TrimLeft([]uint8, string) []uint8
    pkg bytes, func TrimLeftFunc([]uint8, func(int32) bool) []uint8
    pkg bytes, func TrimRight([]uint8, string) []uint8
    pkg bytes, func TrimRightFunc([]uint8, func(int32) bool) []uint8
    pkg bytes, func TrimSpace([]uint8) []uint8
    pkg bytes, method (*Buffer) Bytes() []uint8
    pkg bytes, method (*Buffer) Len() int
    pkg bytes, method (*Buffer) Next(int) []uint8
    Plain Text
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Aug 14 18:58:28 GMT 2013
    - 1.7M bytes
    - Viewed (1)
Back to top