Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for TrimLeftFunc (0.23 sec)

  1. src/bytes/example_test.go

    	// Output:
    	// gopher8257
    }
    
    func ExampleTrimLeftFunc() {
    	fmt.Println(string(bytes.TrimLeftFunc([]byte("go-gopher"), unicode.IsLetter)))
    	fmt.Println(string(bytes.TrimLeftFunc([]byte("go-gopher!"), unicode.IsPunct)))
    	fmt.Println(string(bytes.TrimLeftFunc([]byte("1234go-gopher!567"), unicode.IsNumber)))
    	// Output:
    	// -gopher
    	// go-gopher!
    	// go-gopher!567
    }
    
    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

    				prev = r
    				return unicode.ToTitle(r)
    			}
    			prev = r
    			return r
    		},
    		s)
    }
    
    // TrimLeftFunc treats s as UTF-8-encoded bytes and returns a subslice of s by slicing off
    // all leading UTF-8-encoded code points c that satisfy f(c).
    func TrimLeftFunc(s []byte, f func(r rune) bool) []byte {
    	i := indexFunc(s, f, false)
    	if i == -1 {
    		return nil
    	}
    	return s[i:]
    }
    
    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

    	for _, tc := range trimFuncTests {
    		trimmers := []struct {
    			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. cmd/object-handlers.go

    						for k, v := range ci.Metadata {
    							w.Header().Set(k, v)
    						}
    
    						if opts.PartNumber > 0 && strings.Contains(ci.ETag, "-") {
    							w.Header()[xhttp.AmzMpPartsCount] = []string{
    								strings.TrimLeftFunc(ci.ETag, func(r rune) bool {
    									return !unicode.IsNumber(r)
    								}),
    							}
    						}
    
    						// For providing ranged content
    						start, rangeLen, err := rs.GetOffsetLength(ci.Size)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 22 17:49:30 GMT 2024
    - 125K bytes
    - Viewed (0)
  5. api/go1.txt

    pkg bytes, func Trim([]uint8, string) []uint8
    pkg bytes, func TrimFunc([]uint8, func(int32) bool) []uint8
    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
    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