Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for EqualFold (0.23 sec)

  1. src/bytes/bytes_test.go

    }
    
    func TestEqualFold(t *testing.T) {
    	for _, tt := range EqualFoldTests {
    		if out := EqualFold([]byte(tt.s), []byte(tt.t)); out != tt.out {
    			t.Errorf("EqualFold(%#q, %#q) = %v, want %v", tt.s, tt.t, out, tt.out)
    		}
    		if out := EqualFold([]byte(tt.t), []byte(tt.s)); out != tt.out {
    			t.Errorf("EqualFold(%#q, %#q) = %v, want %v", tt.t, tt.s, out, tt.out)
    		}
    	}
    }
    
    var cutTests = []struct {
    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)
  2. src/bytes/example_test.go

    	fmt.Println(bytes.Equal([]byte("Go"), []byte("Go")))
    	fmt.Println(bytes.Equal([]byte("Go"), []byte("C++")))
    	// Output:
    	// true
    	// false
    }
    
    func ExampleEqualFold() {
    	fmt.Println(bytes.EqualFold([]byte("Go"), []byte("go")))
    	// Output: true
    }
    
    func ExampleFields() {
    	fmt.Printf("Fields are: %q", bytes.Fields([]byte("  foo bar  baz   ")))
    	// Output: Fields are: ["foo" "bar" "baz"]
    }
    
    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

    // for a k-rune slice.
    func ReplaceAll(s, old, new []byte) []byte {
    	return Replace(s, old, new, -1)
    }
    
    // EqualFold reports whether s and t, interpreted as UTF-8 strings,
    // are equal under simple Unicode case-folding, which is a more general
    // form of case-insensitivity.
    func EqualFold(s, t []byte) bool {
    	// ASCII fast path
    	i := 0
    	for ; i < len(s) && i < len(t); i++ {
    		sr := s[i]
    		tr := t[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)
Back to top