Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for LastIndexFunc (0.26 sec)

  1. src/bytes/bytes.go

    func IndexFunc(s []byte, f func(r rune) bool) int {
    	return indexFunc(s, f, true)
    }
    
    // LastIndexFunc interprets s as a sequence of UTF-8-encoded code points.
    // It returns the byte index in s of the last Unicode
    // code point satisfying f(c), or -1 if none do.
    func LastIndexFunc(s []byte, f func(r rune) bool) int {
    	return lastIndexFunc(s, f, true)
    }
    
    // indexFunc is the same as IndexFunc except that if
    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)
  2. src/bytes/example_test.go

    	// Output:
    	// 3
    	// 8
    	// -1
    }
    
    func ExampleLastIndexFunc() {
    	fmt.Println(bytes.LastIndexFunc([]byte("go gopher!"), unicode.IsLetter))
    	fmt.Println(bytes.LastIndexFunc([]byte("go gopher!"), unicode.IsPunct))
    	fmt.Println(bytes.LastIndexFunc([]byte("go gopher!"), unicode.IsNumber))
    	// Output:
    	// 8
    	// 9
    	// -1
    }
    
    func ExampleMap() {
    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_test.go

    		first := IndexFunc([]byte(tc.in), tc.f.f)
    		if first != tc.first {
    			t.Errorf("IndexFunc(%q, %s) = %d; want %d", tc.in, tc.f.name, first, tc.first)
    		}
    		last := LastIndexFunc([]byte(tc.in), tc.f.f)
    		if last != tc.last {
    			t.Errorf("LastIndexFunc(%q, %s) = %d; want %d", tc.in, tc.f.name, last, tc.last)
    		}
    	}
    }
    
    type ReplaceTest struct {
    	in       string
    	old, new string
    	n        int
    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)
  4. api/go1.txt

    pkg bytes, func IndexRune([]uint8, int32) int
    pkg bytes, func Join([][]uint8, []uint8) []uint8
    pkg bytes, func LastIndex([]uint8, []uint8) int
    pkg bytes, func LastIndexAny([]uint8, string) int
    pkg bytes, func LastIndexFunc([]uint8, func(int32) bool) int
    pkg bytes, func Map(func(int32) int32, []uint8) []uint8
    pkg bytes, func NewBuffer([]uint8) *Buffer
    pkg bytes, func NewBufferString(string) *Buffer
    pkg bytes, func NewReader([]uint8) *Reader
    Plain Text
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Aug 14 18:58:28 GMT 2013
    - 1.7M bytes
    - Viewed (1)
Back to top