Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for ContainsFunc (0.11 sec)

  1. src/bytes/example_test.go

    	// true
    	// false
    	// true
    	// true
    	// false
    }
    
    func ExampleContainsFunc() {
    	f := func(r rune) bool {
    		return r >= 'a' && r <= 'z'
    	}
    	fmt.Println(bytes.ContainsFunc([]byte("HELLO"), f))
    	fmt.Println(bytes.ContainsFunc([]byte("World"), f))
    	// Output:
    	// false
    	// true
    }
    
    func ExampleCount() {
    	fmt.Println(bytes.Count([]byte("cheese"), []byte("e")))
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Aug 07 17:22:36 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  2. api/go1.21.txt

    pkg bytes, func ContainsFunc([]uint8, func(int32) bool) bool #54386
    pkg bytes, method (*Buffer) AvailableBuffer() []uint8 #53685
    pkg bytes, method (*Buffer) Available() int #53685
    pkg cmp, func Compare[$0 Ordered]($0, $0) int #59488
    pkg cmp, func Less[$0 Ordered]($0, $0) bool #59488
    pkg cmp, type Ordered interface {} #59488
    pkg context, func AfterFunc(Context, func()) func() bool #57928
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Aug 07 09:39:17 UTC 2023
    - 25.6K bytes
    - Viewed (0)
  3. src/bytes/bytes.go

    // ContainsRune reports whether the rune is contained in the UTF-8-encoded byte slice b.
    func ContainsRune(b []byte, r rune) bool {
    	return IndexRune(b, r) >= 0
    }
    
    // ContainsFunc reports whether any of the UTF-8-encoded code points r within b satisfy f(r).
    func ContainsFunc(b []byte, f func(rune) bool) bool {
    	return IndexFunc(b, f) >= 0
    }
    
    // IndexByte returns the index of the first instance of c in b, or -1 if c is not present in b.
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Sep 03 20:55:15 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  4. src/bytes/bytes_test.go

    				ct.b, ct.r, !ct.expected, ct.expected)
    		}
    	}
    }
    
    func TestContainsFunc(t *testing.T) {
    	for _, ct := range ContainsRuneTests {
    		if ContainsFunc(ct.b, func(r rune) bool {
    			return ct.r == r
    		}) != ct.expected {
    			t.Errorf("ContainsFunc(%q, func(%q)) = %v, want %v",
    				ct.b, ct.r, !ct.expected, ct.expected)
    		}
    	}
    }
    
    var makeFieldsInput = func() []byte {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Aug 19 19:09:04 UTC 2024
    - 61.2K bytes
    - Viewed (0)
  5. src/cmd/cgo/gcc.go

    		prefix = "C"
    	}
    	n.Mangle = prefix + n.Kind + "_" + n.Go
    }
    
    func (f *File) isMangledName(s string) bool {
    	t, ok := strings.CutPrefix(s, "_C")
    	if !ok {
    		return false
    	}
    	return slices.ContainsFunc(nameKinds, func(k string) bool {
    		return strings.HasPrefix(t, k+"_")
    	})
    }
    
    // rewriteCalls rewrites all calls that pass pointers to check that
    // they follow the rules for passing pointers between Go and C.
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Sep 18 15:07:34 UTC 2024
    - 97.1K bytes
    - Viewed (0)
Back to top