Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for IndexRune (0.05 sec)

  1. internal/etag/etag.go

    // has been uploaded using the S3 singlepart API.
    //
    // Parts may panic if the ETag is an invalid multipart
    // ETag.
    func (e ETag) Parts() int {
    	if !e.IsMultipart() {
    		return 1
    	}
    
    	n := bytes.IndexRune(e, '-')
    	parts, err := strconv.Atoi(string(e[n+1:]))
    	if err != nil {
    		panic(err) // malformed ETag
    	}
    	return parts
    }
    
    // Format returns an ETag that is formatted as specified
    // by AWS S3.
    //
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Mar 10 21:09:36 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  2. src/bytes/example_test.go

    	fmt.Println(bytes.IndexAny([]byte("crwth"), "aeiouy"))
    	// Output:
    	// 2
    	// -1
    }
    
    func ExampleIndexRune() {
    	fmt.Println(bytes.IndexRune([]byte("chicken"), 'k'))
    	fmt.Println(bytes.IndexRune([]byte("chicken"), 'd'))
    	// Output:
    	// 4
    	// -1
    }
    
    func ExampleJoin() {
    	s := [][]byte{[]byte("foo"), []byte("bar"), []byte("baz")}
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Aug 07 17:22:36 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  3. src/bytes/bytes.go

    	return bytealg.LastIndexByte(s, c)
    }
    
    // IndexRune interprets s as a sequence of UTF-8-encoded code points.
    // It returns the byte index of the first occurrence in s of the given rune.
    // It returns -1 if rune is not present in s.
    // If r is [utf8.RuneError], it returns the first instance of any
    // invalid UTF-8 byte sequence.
    func IndexRune(s []byte, r rune) int {
    	const haveFastIndex = bytealg.MaxBruteForce > 0
    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/cmd/asm/internal/lex/input.go

    func predefine(defines flags.MultiFlag) map[string]*Macro {
    	macros := make(map[string]*Macro)
    	for _, name := range defines {
    		value := "1"
    		i := strings.IndexRune(name, '=')
    		if i > 0 {
    			name, value = name[:i], name[i+1:]
    		}
    		tokens := Tokenize(name)
    		if len(tokens) != 1 || tokens[0].ScanToken != scanner.Ident {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Sep 06 13:17:27 UTC 2024
    - 12.5K bytes
    - Viewed (0)
Back to top