Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for ContainsFunc (0.32 sec)

  1. 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
    Plain Text
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Aug 07 09:39:17 GMT 2023
    - 25.6K bytes
    - Viewed (0)
  2. 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")))
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  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.
    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)
  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 {
    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)
Back to top