Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for indexOf (0.16 sec)

  1. doc/go1.17_spec.html

    f := i.M; f(7)  // like i.M(7)
    </pre>
    
    
    <h3 id="Index_expressions">Index expressions</h3>
    
    <p>
    A primary expression of the form
    </p>
    
    <pre>
    a[x]
    </pre>
    
    <p>
    denotes the element of the array, pointer to array, slice, string or map <code>a</code> indexed by <code>x</code>.
    The value <code>x</code> is called the <i>index</i> or <i>map key</i>, respectively.
    The following rules apply:
    HTML
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 211.6K bytes
    - Viewed (0)
  2. src/bytes/example_test.go

    	fmt.Println(bytes.HasSuffix([]byte("Amigo"), []byte("")))
    	// Output:
    	// true
    	// false
    	// false
    	// true
    }
    
    func ExampleIndex() {
    	fmt.Println(bytes.Index([]byte("chicken"), []byte("ken")))
    	fmt.Println(bytes.Index([]byte("chicken"), []byte("dmr")))
    	// Output:
    	// 4
    	// -1
    }
    
    func ExampleIndexByte() {
    	fmt.Println(bytes.IndexByte([]byte("chicken"), byte('k')))
    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/cmd/asm/internal/asm/testdata/ppc64.s

    // This contains the majority of valid opcode combinations
    // available in cmd/internal/obj/ppc64/asm9.go with
    // their valid instruction encodings.
    
    #include "../../../../../runtime/textflag.h"
    
    // In case of index mode instructions, usage of
    // (Rx)(R0) is equivalent to (Rx+R0)
    // In case of base+displacement mode instructions if
    // the offset is 0, usage of (Rx) is equivalent to 0(Rx)
    TEXT asmtest(SB),DUPOK|NOSPLIT,$0
    Others
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Apr 24 15:53:25 GMT 2024
    - 49K bytes
    - Viewed (0)
  4. src/bytes/bytes.go

    		}
    		if r == tr {
    			continue
    		}
    		return false
    	}
    
    	// One string is empty. Are both?
    	return len(s) == len(t)
    }
    
    // Index returns the index of the first instance of sep in s, or -1 if sep is not present in s.
    func Index(s, sep []byte) int {
    	n := len(sep)
    	switch {
    	case n == 0:
    		return 0
    	case n == 1:
    		return IndexByte(s, sep[0])
    	case n == len(s):
    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)
  5. src/cmd/asm/internal/asm/parse.go

    		}
    		num = int16(amount)
    	} else if p.peek() == '[' {
    		// parses an element: [Index]
    		p.get('[')
    		tok := p.get(scanner.Int)
    		index, err := strconv.ParseInt(tok.String(), 10, 16)
    		p.get(']')
    		if err != nil {
    			p.errorf("parsing element index: %s", err)
    		}
    		isIndex = true
    		isAmount = false
    		num = int16(index)
    	}
    
    	switch p.arch.Family {
    	case sys.ARM64:
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Feb 21 14:34:57 GMT 2024
    - 36.9K bytes
    - Viewed (0)
  6. doc/go_spec.html

    f := i.M; f(7)  // like i.M(7)
    </pre>
    
    
    <h3 id="Index_expressions">Index expressions</h3>
    
    <p>
    A primary expression of the form
    </p>
    
    <pre>
    a[x]
    </pre>
    
    <p>
    denotes the element of the array, pointer to array, slice, string or map <code>a</code> indexed by <code>x</code>.
    The value <code>x</code> is called the <i>index</i> or <i>map key</i>, respectively.
    The following rules apply:
    HTML
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Thu May 02 22:43:51 GMT 2024
    - 279.6K bytes
    - Viewed (0)
  7. src/builtin/builtin.go

    type comparable interface{ comparable }
    
    // iota is a predeclared identifier representing the untyped integer ordinal
    // number of the current const specification in a (usually parenthesized)
    // const declaration. It is zero-indexed.
    const iota = 0 // Untyped int.
    
    // nil is a predeclared identifier representing the zero value for a
    // pointer, channel, func, interface, map, or slice type.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  8. src/archive/tar/writer_test.go

    		t.Fatal("Expected at least one PAX header to be written.")
    	}
    
    	// xattr bar should always appear before others
    	indices := []int{
    		bytes.Index(buf.Bytes(), []byte("bar=bar")),
    		bytes.Index(buf.Bytes(), []byte("baz=baz")),
    		bytes.Index(buf.Bytes(), []byte("foo=foo")),
    		bytes.Index(buf.Bytes(), []byte("qux=qux")),
    	}
    	if !sort.IntsAreSorted(indices) {
    		t.Fatal("PAX headers are not sorted")
    	}
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Feb 27 16:39:23 GMT 2024
    - 38.7K bytes
    - Viewed (0)
  9. src/cmd/api/main_test.go

    		}
    	}
    
    	var features []string
    	for f, cmap := range featureCtx {
    		if len(cmap) == len(contexts) {
    			features = append(features, f)
    			continue
    		}
    		comma := strings.Index(f, ",")
    		for cname := range cmap {
    			f2 := fmt.Sprintf("%s (%s)%s", f[:comma], cname, f[comma:])
    			features = append(features, f2)
    		}
    	}
    
    	bw := bufio.NewWriter(os.Stdout)
    	defer bw.Flush()
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Apr 09 20:48:51 GMT 2024
    - 31.4K bytes
    - Viewed (0)
  10. doc/go_mem.html

    For example, a compiler must not discard <code>i</code> and reload it
    a second time from <code>*p</code> in this program:
    </p>
    
    <pre>
    i := *p
    if i &lt; 0 || i &gt;= len(funcs) {
    	panic("invalid function index")
    }
    ... complex code ...
    // compiler must NOT reload i = *p here
    funcs[i]()
    </pre>
    
    <p>
    If the complex code needs many registers, a compiler for single-threaded programs
    HTML
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Mon Mar 04 15:54:42 GMT 2024
    - 26.6K bytes
    - Viewed (0)
Back to top